aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js')
-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 !== ""){