From 7a7ac1d6479155760d99b7ecdf5a8d1f63e25f24 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 22 Mar 2012 10:46:39 -0700 Subject: IKNINJA-1361: autofocus and auto-select file name on open of new file and save as dialog Signed-off-by: Ananya Sen --- js/io/ui/file-picker/file-picker-controller.js | 2 -- js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js | 2 ++ js/io/ui/save-as-dialog.reel/save-as-dialog.js | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/js/io/ui/file-picker/file-picker-controller.js b/js/io/ui/file-picker/file-picker-controller.js index e3276ee6..436a50f3 100755 --- a/js/io/ui/file-picker/file-picker-controller.js +++ b/js/io/ui/file-picker/file-picker-controller.js @@ -130,8 +130,6 @@ var FilePickerController = exports.FilePickerController = Montage.create(require } if(!!storedUri){ - // This is depracated -- use decodeURI instead - //aModel.currentRoot = unescape(storedUri); aModel.currentRoot = decodeURI(storedUri); } diff --git a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js index 811231e4..fac4c488 100755 --- a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js +++ b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js @@ -23,6 +23,8 @@ var NewFileLocation = exports.NewFileLocation = Montage.create(Component, { this.fileInputField.selectDirectory = true; this.newFileName.addEventListener("keyup", this, false); + this.newFileName.focus(); + this.newFileName.select(); } }, 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 4d07ca66..1910f30d 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 @@ -60,6 +60,9 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { this.okButton.addEventListener("click", function(evt){self.handleOkButtonAction(evt);}, false); this.cancelButton.addEventListener("click", function(evt){self.handleCancelButtonAction(evt);}, false); + this.newFileName.focus(); + this.newFileName.select(); + this.enableOk(); } }, -- cgit v1.2.3