aboutsummaryrefslogtreecommitdiff
path: root/js/io
diff options
context:
space:
mode:
authorAnanya Sen2012-03-22 14:49:17 -0700
committerAnanya Sen2012-03-22 14:49:17 -0700
commit80ceeffeb3dd3227008714b8b56383f9556ff409 (patch)
treee3c385228659997ee36770d7c5ee6987442aec6b /js/io
parent87cf1d7d899bb60581d5e5c6c7ba678620c7148e (diff)
downloadninja-80ceeffeb3dd3227008714b8b56383f9556ff409.tar.gz
KNINJA-1302 : refactored fixed as per request
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/io')
-rw-r--r--js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js9
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js15
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.js15
3 files changed, 39 insertions, 0 deletions
diff --git a/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
index 3cf6fc5a..945b0301 100644
--- a/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
+++ b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
@@ -261,8 +261,17 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
261 this.okButton.addEventListener("click", function(evt){that.handleOkButtonAction(evt);}, false); 261 this.okButton.addEventListener("click", function(evt){that.handleOkButtonAction(evt);}, false);
262 this.cancelButton.addEventListener("click", function(evt){that.handleCancelButtonAction(evt);}, false); 262 this.cancelButton.addEventListener("click", function(evt){that.handleCancelButtonAction(evt);}, false);
263 263
264 this.element.addEventListener("keyup", function(evt){
265 if(evt.keyCode == 27) {
266 if(that.application.ninja.filePickerController.pickerNavChoices !== null){
267 that.handleCancelButtonAction();
268 }
269 }
270 }, true);
271
264 //ready to show picker now 272 //ready to show picker now
265 this.element.style.visibility = "visible"; 273 this.element.style.visibility = "visible";
274 this.element.focus();
266 } 275 }
267 }, 276 },
268 277
diff --git a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
index ecee7c1d..18556bc5 100644
--- a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
+++ b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
@@ -130,6 +130,21 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
130 130
131 this.okButton.addEventListener("click", function(evt){that.handleOkButtonAction(evt);}, false); 131 this.okButton.addEventListener("click", function(evt){that.handleOkButtonAction(evt);}, false);
132 this.cancelButton.addEventListener("click", function(evt){that.handleCancelButtonAction(evt);}, false); 132 this.cancelButton.addEventListener("click", function(evt){that.handleCancelButtonAction(evt);}, false);
133
134 this.element.addEventListener("keyup", function(evt){
135 if(evt.keyCode == 27) {//ESC key
136 if(that.application.ninja.newFileController.newFileOptionsNav !== null){
137 that.handleCancelButtonAction();
138 }
139 }else if((evt.keyCode == 13) && !(evt.ctrlKey || evt.metaKey)){//ENTER key
140 if((that.application.ninja.newFileController.newFileOptionsNav !== null)
141 && !that.okButton.hasAttribute("disabled")){
142
143 that.handleOkButtonAction();
144 }
145 }
146 }, true);
147
133 } 148 }
134 149
135 }, 150 },
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 dfaac1aa..d59d5be1 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
@@ -64,6 +64,21 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, {
64 this.newFileName.select(); 64 this.newFileName.select();
65 65
66 this.enableOk(); 66 this.enableOk();
67
68 this.element.addEventListener("keyup", function(evt){
69 if(evt.keyCode == 27) {//ESC key
70 if(self.application.ninja.newFileController.saveAsDialog !== null){
71 self.handleCancelButtonAction();
72 }
73 }else if((evt.keyCode == 13) && !(evt.ctrlKey || evt.metaKey)){//ENTER key
74 if((self.application.ninja.newFileController.saveAsDialog !== null)
75 && !self.okButton.hasAttribute("disabled")){
76
77 self.handleOkButtonAction();
78 }
79 }
80 }, true);
81
67 } 82 }
68 }, 83 },
69 84