aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui/new-file-dialog
diff options
context:
space:
mode:
Diffstat (limited to 'js/io/ui/new-file-dialog')
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js15
1 files changed, 15 insertions, 0 deletions
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 },