aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui/file-picker/file-input-field.reel/file-input-field.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-04-05 11:46:46 -0700
committerValerio Virgillito2012-04-05 11:46:46 -0700
commitc00f59e9484580c07cd812f0578b920229228054 (patch)
tree83b42e708cd27a06a09d0dae66691507fd433740 /js/io/ui/file-picker/file-input-field.reel/file-input-field.js
parent91ffa45e4eb69b1434460f9b6c618745ac19a74e (diff)
parent5de25f936c9dce08f1d24824ae1946a07e7b708d (diff)
downloadninja-c00f59e9484580c07cd812f0578b920229228054.tar.gz
Merge pull request #158 from ananyasen/integration-candidate
- disable ok when text box is cleared using backspace and cross, for fil...
Diffstat (limited to 'js/io/ui/file-picker/file-input-field.reel/file-input-field.js')
-rwxr-xr-xjs/io/ui/file-picker/file-input-field.reel/file-input-field.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js
index 46e8b386..0f66468a 100755
--- a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js
+++ b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js
@@ -21,6 +21,7 @@ var FileInputField = exports.FileInputField = Montage.create(Component, {
21 21
22 this.newFileDirectory.addEventListener("keyup", function(evt){that.handleNewFileDirectoryOnkeyup(evt);}, false); 22 this.newFileDirectory.addEventListener("keyup", function(evt){that.handleNewFileDirectoryOnkeyup(evt);}, false);
23 this.newFileDirectory.addEventListener("paste", this, false); 23 this.newFileDirectory.addEventListener("paste", this, false);
24 this.newFileDirectory.addEventListener("search", this, false);
24 } 25 }
25 }, 26 },
26 27
@@ -74,16 +75,20 @@ var FileInputField = exports.FileInputField = Montage.create(Component, {
74 75
75 handleNewFileDirectoryOnkeyup:{ 76 handleNewFileDirectoryOnkeyup:{
76 value:function(evt){ 77 value:function(evt){
77 if(this.newFileDirectory.value !== ""){ 78 var newFileDirectorySetEvent = document.createEvent("Events");
78 var newFileDirectorySetEvent = document.createEvent("Events"); 79 newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false);
79 newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false); 80 newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value;
80 newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value; 81 newFileDirectorySetEvent.keyCode = evt.keyCode;
81 newFileDirectorySetEvent.keyCode = evt.keyCode; 82 this.eventManager.dispatchEvent(newFileDirectorySetEvent);
82 this.eventManager.dispatchEvent(newFileDirectorySetEvent);
83 }
84 } 83 }
85 }, 84 },
86 85
86 handleSearch:{
87 value:function(evt){
88 this.handleNewFileDirectoryOnkeyup(evt);
89 }
90 },
91
87 handleFileInputPickerSelectionsDone:{ 92 handleFileInputPickerSelectionsDone:{
88 value: function(evt){ 93 value: function(evt){
89 var selectedUri = ""; 94 var selectedUri = "";
@@ -105,7 +110,7 @@ var FileInputField = exports.FileInputField = Montage.create(Component, {
105 if(!!obj && obj.uri && obj.uri.length > 0){ 110 if(!!obj && obj.uri && obj.uri.length > 0){
106 selectedUri = obj.uri[0]; 111 selectedUri = obj.uri[0];
107 this.newFileDirectory.value = selectedUri; 112 this.newFileDirectory.value = selectedUri;
108 113 this.newFileDirectory.focus();
109 var newFileDirectorySetEvent = document.createEvent("Events"); 114 var newFileDirectorySetEvent = document.createEvent("Events");
110 newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false); 115 newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false);
111 newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value; 116 newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value;