aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui/save-as-dialog.reel
diff options
context:
space:
mode:
authorAnanya Sen2012-03-30 16:31:18 -0700
committerAnanya Sen2012-03-30 16:31:18 -0700
commitd4a682ddca0248e0dd7d8871dddbd167bd020a18 (patch)
tree673455ed0df96f8174a195c700b3e534bceed5d9 /js/io/ui/save-as-dialog.reel
parent834086b91afc752745128a0c2be4730bf1c7858d (diff)
downloadninja-d4a682ddca0248e0dd7d8871dddbd167bd020a18.tar.gz
- using clipboard data directly to avoid using setTimeout
- fixed logical error to trigger OK on Enter key pressed 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.js11
1 files changed, 5 insertions, 6 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 2bc141f7..c5ed8d33 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
@@ -85,8 +85,8 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, {
85 85
86 handleNewFileDirectorySet:{ 86 handleNewFileDirectorySet:{
87 value:function(evt){ 87 value:function(evt){
88 if((evt.keyCode === 13) && !this.okButton.hasAttribute("disabled")){ 88 if(evt.keyCode === 13){
89 this.handleOkButtonAction(evt); 89 if(!this.okButton.hasAttribute("disabled")) this.handleOkButtonAction(evt);
90 }else if(evt.keyCode === 27){ 90 }else if(evt.keyCode === 27){
91 this.handleCancelButtonAction(evt); 91 this.handleCancelButtonAction(evt);
92 } 92 }
@@ -101,10 +101,9 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, {
101 101
102 handlePaste:{ 102 handlePaste:{
103 value:function(evt){ 103 value:function(evt){
104 var self=this; 104 evt.preventDefault();
105 setTimeout(function(){ 105 evt.target.value = evt.clipboardData.getData("Text");
106 self.handleNewFileNameOnkeyup(evt); 106 this.handleNewFileNameOnkeyup(evt);
107 }, 1);
108 } 107 }
109 }, 108 },
110 109