aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-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
-rwxr-xr-xjs/mediators/keyboard-mediator.js31
4 files changed, 39 insertions, 31 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
diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js
index 63dcfa88..fc0d0f6a 100755
--- a/js/mediators/keyboard-mediator.js
+++ b/js/mediators/keyboard-mediator.js
@@ -245,37 +245,6 @@ exports.KeyboardMediator = Montage.create(Component, {
245 //menuViewManagerModule.MenuViewManager.closeMenu("mainMenuBar"); 245 //menuViewManagerModule.MenuViewManager.closeMenu("mainMenuBar");
246 return; 246 return;
247 } 247 }
248
249 // check for ENTER key
250 if((evt.keyCode == Keyboard.ENTER) && !(evt.ctrlKey || evt.metaKey)) {
251 //new file
252 if((this.application.ninja.newFileController.newFileOptionsNav !== null)
253 && !this.application.ninja.newFileController.newFileOptionsNav.okButton.hasAttribute("disabled")){
254
255 this.application.ninja.newFileController.newFileOptionsNav.handleOkButtonAction();
256 }
257 //save as
258 if((this.application.ninja.newFileController.saveAsDialog !== null)
259 && !this.application.ninja.newFileController.saveAsDialog.okButton.hasAttribute("disabled")){
260
261 this.application.ninja.newFileController.saveAsDialog.handleOkButtonAction();
262 }
263 return;
264 }
265 //ESC key
266 if(evt.keyCode === Keyboard.ESCAPE){
267 if(this.application.ninja.filePickerController.pickerNavChoices !== null){
268 this.application.ninja.filePickerController.pickerNavChoices.handleCancelButtonAction();
269 }
270 if(this.application.ninja.newFileController.newFileOptionsNav !== null){
271 this.application.ninja.newFileController.newFileOptionsNav.handleCancelButtonAction();
272 }
273 if(this.application.ninja.newFileController.saveAsDialog !== null){
274 this.application.ninja.newFileController.saveAsDialog.handleCancelButtonAction();
275 }
276 return;
277 }
278
279 } 248 }
280 }, 249 },
281 250