diff options
author | Ananya Sen | 2012-03-22 14:49:17 -0700 |
---|---|---|
committer | Ananya Sen | 2012-03-22 14:49:17 -0700 |
commit | 80ceeffeb3dd3227008714b8b56383f9556ff409 (patch) | |
tree | e3c385228659997ee36770d7c5ee6987442aec6b /js/io/ui/save-as-dialog.reel | |
parent | 87cf1d7d899bb60581d5e5c6c7ba678620c7148e (diff) | |
download | ninja-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/save-as-dialog.reel')
-rw-r--r-- | js/io/ui/save-as-dialog.reel/save-as-dialog.js | 15 |
1 files changed, 15 insertions, 0 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 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 | ||