aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui/new-file-dialog/new-file-options-navigator.reel
diff options
context:
space:
mode:
authorAnanya Sen2012-02-09 11:12:21 -0800
committerAnanya Sen2012-02-09 11:12:21 -0800
commitc9d0cb73698066247c6267bba8fa446a979565fb (patch)
tree8d706201eb23565e41e288c710e9ff8a83639113 /js/io/ui/new-file-dialog/new-file-options-navigator.reel
parent04d375a02e44d1c11054ace16cd243ada8e6bd23 (diff)
downloadninja-c9d0cb73698066247c6267bba8fa446a979565fb.tar.gz
fixed templates descriptor, changed validation to on key up, fixed minor ui issues
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/io/ui/new-file-dialog/new-file-options-navigator.reel')
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js9
1 files changed, 5 insertions, 4 deletions
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 2f148621..bcb9d123 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
@@ -217,8 +217,9 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
217 if(/[^/\\]$/g.test(projectDirectory)){ 217 if(/[^/\\]$/g.test(projectDirectory)){
218 projectDirectory = projectDirectory + "/"; 218 projectDirectory = projectDirectory + "/";
219 } 219 }
220 if(!!fileExtension && (projectName.lastIndexOf(fileExtension) !== (projectName.length - fileExtension.length))){ 220
221 projectName = projectName+fileExtension; 221 if(!!fileExtension && ((projectName.lastIndexOf(fileExtension) === -1) || (projectName.lastIndexOf(fileExtension) !== (projectName.length - fileExtension.length)))){
222 projectName = projectName+fileExtension;//append file extension if file extension is already not present or is actually part of the file name
222 } 223 }
223 newFilePath = "" + projectDirectory + projectName; 224 newFilePath = "" + projectDirectory + projectName;
224 225
@@ -367,7 +368,7 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
367 }, 368 },
368 isValidFileName:{ 369 isValidFileName:{
369 value: function(fileName){ 370 value: function(fileName){
370 var status = this.isValidFileName(fileName); 371 var status = this.validateFileName(fileName);
371 if(fileName !== ""){ 372 if(fileName !== ""){
372 if(!status){ 373 if(!status){
373 this.showError("! Invalid file name."); 374 this.showError("! Invalid file name.");
@@ -399,7 +400,7 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
399 /*** 400 /***
400 * file name validation 401 * file name validation
401 */ 402 */
402 isValidFileName:{ 403 validateFileName:{
403 value: function(fileName){ 404 value: function(fileName){
404 var status = false; 405 var status = false;
405 if(fileName !== ""){ 406 if(fileName !== ""){