aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui/new-file-dialog
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/ui/new-file-dialog
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/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 },