diff options
Diffstat (limited to 'js/io/ui/save-as-dialog.reel')
-rw-r--r-- | js/io/ui/save-as-dialog.reel/save-as-dialog.js | 23 |
1 files changed, 21 insertions, 2 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 c60a92f9..98749106 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 | |||
@@ -83,6 +83,11 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { | |||
83 | this.enableOk(); | 83 | this.enableOk(); |
84 | } | 84 | } |
85 | } | 85 | } |
86 | if(evt.keyCode === 13){ | ||
87 | if(!this.okButton.hasAttribute("disabled")){ | ||
88 | this.handleOkButtonAction(evt); | ||
89 | } | ||
90 | } | ||
86 | } | 91 | } |
87 | }, | 92 | }, |
88 | 93 | ||
@@ -99,7 +104,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { | |||
99 | handleCancelButtonAction :{ | 104 | handleCancelButtonAction :{ |
100 | value:function(evt){ | 105 | value:function(evt){ |
101 | //clean up memory | 106 | //clean up memory |
102 | //this.cleanup(); | 107 | this.cleanup(); |
103 | 108 | ||
104 | if(this.popup){ | 109 | if(this.popup){ |
105 | this.popup.hide(); | 110 | this.popup.hide(); |
@@ -134,7 +139,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { | |||
134 | 139 | ||
135 | if(success){ | 140 | if(success){ |
136 | //clean up memory | 141 | //clean up memory |
137 | //this.cleanup(); | 142 | this.cleanup(); |
138 | 143 | ||
139 | if(this.popup){ | 144 | if(this.popup){ |
140 | this.popup.hide(); | 145 | this.popup.hide(); |
@@ -227,6 +232,20 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { | |||
227 | } | 232 | } |
228 | return status; | 233 | return status; |
229 | } | 234 | } |
235 | }, | ||
236 | |||
237 | cleanup:{ | ||
238 | value:function(){ | ||
239 | var self = this; | ||
240 | |||
241 | //remove event listener | ||
242 | this.newFileName.removeEventListener("keyup", function(evt){self.handleNewFileNameOnkeyup(evt);}, false); | ||
243 | this.eventManager.removeEventListener("newFileDirectorySet", function(evt){self.handleNewFileDirectorySet(evt);}, false); | ||
244 | this.okButton.removeEventListener("click", function(evt){self.handleOkButtonAction(evt);}, false); | ||
245 | this.cancelButton.removeEventListener("click", function(evt){self.handleCancelButtonAction(evt);}, false); | ||
246 | |||
247 | this.application.ninja.newFileController.saveAsDialog = null; | ||
230 | } | 248 | } |
249 | } | ||
231 | 250 | ||
232 | }); \ No newline at end of file | 251 | }); \ No newline at end of file |