From 85bf9f937fa2ec46e42f791fc6815f7c2f5446ea Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 22 Mar 2012 10:42:05 -0700 Subject: file picker - added size unit new file - don't disable OK is file exists Signed-off-by: Ananya Sen --- .../picker-navigator.reel/picker-navigator.js | 2 +- .../new-file-options-navigator.js | 26 +++++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) (limited to 'js/io/ui') diff --git a/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js index e31fa29d..3cf6fc5a 100644 --- a/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js +++ b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js @@ -500,7 +500,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { metadata = "Name: "+data.name; } metadata = metadata + "
" + "Type: "+data.type; - if(data.size){metadata = metadata + "
" + "Size: "+data.size;} + if(data.size){metadata = metadata + "
" + "Size: "+data.size+" bytes";} if(data.creationDate){metadata = metadata + "
" + "Creation date: "+ this.formatTimestamp(data.creationDate);} if(data.modifiedDate){metadata = metadata + "
" + "Modified date: "+ this.formatTimestamp(data.modifiedDate);} } diff --git a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js index 5adcc250..f63067b1 100644 --- a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js +++ b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js @@ -297,10 +297,16 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C }else{ if(this.error.innerHTML === ""){ this.showError("! Project Template, Name and Directory should be valid."); - } - //disable ok - if(!this.okButton.hasAttribute("disabled")){ - this.okButton.setAttribute("disabled", "true"); + //disable ok + if(!this.okButton.hasAttribute("disabled")){ + this.okButton.setAttribute("disabled", "true"); + } + }else if(!this.selectedProjectType || !this.selectedTemplate){ + this.showError("! Project Template should be selected."); + //disable ok + if(!this.okButton.hasAttribute("disabled")){ + this.okButton.setAttribute("disabled", "true"); + } } } } @@ -399,6 +405,10 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C if(uri !== ""){ if(!status){ this.showError("! Invalid directory."); + //disable ok + if(!this.okButton.hasAttribute("disabled")){ + this.okButton.setAttribute("disabled", "true"); + } } } return status; @@ -410,6 +420,10 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C if(fileName !== ""){ if(!status){ this.showError("! Invalid file name."); + //disable ok + if(!this.okButton.hasAttribute("disabled")){ + this.okButton.setAttribute("disabled", "true"); + } } } return status; @@ -445,10 +459,6 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C value:function(errorString){ this.error.innerHTML = ""; this.error.innerHTML=errorString; - //disable ok - if(!this.okButton.hasAttribute("disabled")){ - this.okButton.setAttribute("disabled", "true"); - } } }, -- cgit v1.2.3