aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui/save-as-dialog.reel
diff options
context:
space:
mode:
authorAnanya Sen2012-03-22 10:38:44 -0700
committerAnanya Sen2012-03-22 10:38:44 -0700
commit2557f463c1cfe2d0dd8ea187c184755bd141dab4 (patch)
treea842cee837b5d0c5a314bdd98b3c96eb98f154da /js/io/ui/save-as-dialog.reel
parent61a419422b1a05a779fd9a66c53de3fa8ab5f65a (diff)
downloadninja-2557f463c1cfe2d0dd8ea187c184755bd141dab4.tar.gz
IKNINJA-1302 : For File>New and File>SaveAll dialogs, 'ESC' key now triggers Cancel button and 'Enter' key now triggers OK button. For File picker, the 'ESC' now triggers the Cancel button.
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com> Conflicts: js/io/ui/new-file-dialog/new-file-workflow-controller.js Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/io/ui/save-as-dialog.reel')
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.js23
1 files changed, 21 insertions, 2 deletions
diff --git a/js/io/ui/save-as-dialog.reel/save-as-dialog.js b/js/io/ui/save-as-dialog.reel/save-as-dialog.js
index c60a92f9..98749106 100644
--- a/js/io/ui/save-as-dialog.reel/save-as-dialog.js
+++ b/js/io/ui/save-as-dialog.reel/save-as-dialog.js
@@ -83,6 +83,11 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, {
83 this.enableOk(); 83 this.enableOk();
84 } 84 }
85 } 85 }
86 if(evt.keyCode === 13){
87 if(!this.okButton.hasAttribute("disabled")){
88 this.handleOkButtonAction(evt);
89 }
90 }
86 } 91 }
87 }, 92 },
88 93
@@ -99,7 +104,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, {
99 handleCancelButtonAction :{ 104 handleCancelButtonAction :{
100 value:function(evt){ 105 value:function(evt){
101 //clean up memory 106 //clean up memory
102 //this.cleanup(); 107 this.cleanup();
103 108
104 if(this.popup){ 109 if(this.popup){
105 this.popup.hide(); 110 this.popup.hide();
@@ -134,7 +139,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, {
134 139
135 if(success){ 140 if(success){
136 //clean up memory 141 //clean up memory
137 //this.cleanup(); 142 this.cleanup();
138 143
139 if(this.popup){ 144 if(this.popup){
140 this.popup.hide(); 145 this.popup.hide();
@@ -227,6 +232,20 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, {
227 } 232 }
228 return status; 233 return status;
229 } 234 }
235 },
236
237 cleanup:{
238 value:function(){
239 var self = this;
240
241 //remove event listener
242 this.newFileName.removeEventListener("keyup", function(evt){self.handleNewFileNameOnkeyup(evt);}, false);
243 this.eventManager.removeEventListener("newFileDirectorySet", function(evt){self.handleNewFileDirectorySet(evt);}, false);
244 this.okButton.removeEventListener("click", function(evt){self.handleOkButtonAction(evt);}, false);
245 this.cancelButton.removeEventListener("click", function(evt){self.handleCancelButtonAction(evt);}, false);
246
247 this.application.ninja.newFileController.saveAsDialog = null;
230 } 248 }
249 }
231 250
232}); \ No newline at end of file 251}); \ No newline at end of file