From 5de25f936c9dce08f1d24824ae1946a07e7b708d Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 4 Apr 2012 19:21:01 -0700 Subject: - disable ok when text box is cleared using backspace and cross, for file name and directory location, in New file and save as dialog Signed-off-by: Ananya Sen --- .../file-input-field.reel/file-input-field.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'js/io/ui/file-picker/file-input-field.reel') 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, { this.newFileDirectory.addEventListener("keyup", function(evt){that.handleNewFileDirectoryOnkeyup(evt);}, false); this.newFileDirectory.addEventListener("paste", this, false); + this.newFileDirectory.addEventListener("search", this, false); } }, @@ -74,16 +75,20 @@ var FileInputField = exports.FileInputField = Montage.create(Component, { handleNewFileDirectoryOnkeyup:{ value:function(evt){ - if(this.newFileDirectory.value !== ""){ - var newFileDirectorySetEvent = document.createEvent("Events"); - newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false); - newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value; - newFileDirectorySetEvent.keyCode = evt.keyCode; - this.eventManager.dispatchEvent(newFileDirectorySetEvent); - } + var newFileDirectorySetEvent = document.createEvent("Events"); + newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false); + newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value; + newFileDirectorySetEvent.keyCode = evt.keyCode; + this.eventManager.dispatchEvent(newFileDirectorySetEvent); } }, + handleSearch:{ + value:function(evt){ + this.handleNewFileDirectoryOnkeyup(evt); + } + }, + handleFileInputPickerSelectionsDone:{ value: function(evt){ var selectedUri = ""; @@ -105,7 +110,7 @@ var FileInputField = exports.FileInputField = Montage.create(Component, { if(!!obj && obj.uri && obj.uri.length > 0){ selectedUri = obj.uri[0]; this.newFileDirectory.value = selectedUri; - + this.newFileDirectory.focus(); var newFileDirectorySetEvent = document.createEvent("Events"); newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false); newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value; -- cgit v1.2.3 From 8acdde3e87f8cabd179a068c54fe5b78fa38e40d Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 5 Apr 2012 22:54:53 -0700 Subject: - using Montage TextField component to handle any edits like keyup, paste, cut. - optimized Enter and Esc key handling Signed-off-by: Ananya Sen --- .../file-input-field.reel/file-input-field.html | 10 +++++- .../file-input-field.reel/file-input-field.js | 37 ++++++++++------------ 2 files changed, 26 insertions(+), 21 deletions(-) (limited to 'js/io/ui/file-picker/file-input-field.reel') diff --git a/js/io/ui/file-picker/file-input-field.reel/file-input-field.html b/js/io/ui/file-picker/file-input-field.reel/file-input-field.html index 2fcaa075..00df1c11 100755 --- a/js/io/ui/file-picker/file-input-field.reel/file-input-field.html +++ b/js/io/ui/file-picker/file-input-field.reel/file-input-field.html @@ -10,13 +10,21 @@