From c627ebb5735d55218813b073c655dae6cded6040 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 10 Feb 2012 15:50:14 -0800 Subject: show iframeContainer if all documents are closed Signed-off-by: Ananya Sen --- js/io/document/document-controller.js | 3 +++ js/io/system/chromeapi.js | 2 +- .../new-file-options-navigator.reel/new-file-options-navigator.js | 5 ++--- js/io/ui/save-as-dialog.reel/save-as-dialog.js | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'js/io') diff --git a/js/io/document/document-controller.js b/js/io/document/document-controller.js index c2a2dab6..6dc7e670 100755 --- a/js/io/document/document-controller.js +++ b/js/io/document/document-controller.js @@ -293,6 +293,9 @@ var DocumentController = exports.DocumentController = Montage.create(Component, nextDocumentIndex = closeDocumentIndex - 1; } this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); + }else{ + //if there are no documents to switch to then just show the iframeContainer + document.getElementById("iframeContainer").style.display="block"; } } }, diff --git a/js/io/system/chromeapi.js b/js/io/system/chromeapi.js index eee7409d..e53d4841 100644 --- a/js/io/system/chromeapi.js +++ b/js/io/system/chromeapi.js @@ -180,7 +180,7 @@ exports.ChromeApi = Montage.create(Object.prototype, { //Checking for directory not to already exist this.fileSystem.root.getDirectory(directoryPath, {}, function(dir) { if (callback) callback(false); - return; //Directory already exists + return false; //Directory already exists }); //Creating new directory this.fileSystem.root.getDirectory(directoryPath, {create: true}, function(dir) { 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 f514b81a..848e0cb8 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 @@ -226,7 +226,7 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C if(!!this.selectedProjectType && !!this.selectedTemplate && this.isValidFileName(projectName) && this.isValidUri(projectDirectory) - && !this.checkFileExists(projectName, projectDirectory, this.selectedProjectType) + && !this.checkFileExists(projectName, projectDirectory, fileExtension) ){ this.error.innerHTML=""; //console.log("$$$ new file selections: \n" + selectionlog); @@ -258,7 +258,7 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C this.popup.hide(); } }else{ - if(this.error.innerHTML !== ""){ + if(this.error.innerHTML === ""){ this.showError("! Project Template, Name and Directory should be valid."); } //disable ok @@ -328,7 +328,6 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C if(!!this.selectedProjectType && !!this.selectedTemplate && this.isValidFileName(this.newFileName) && this.isValidUri(this.newFileDirectory) - && !this.checkFileExists(this.newFileName, this.newFileDirectory, this.newFileModel.projectTypeData[this.selectedProjectType.uri].fileExtension) ){ status = true; this.okButton.removeAttribute("disabled"); 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 4546e124..786ef5c9 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 @@ -89,7 +89,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { enableOk:{ value: function(){ - if(this.isValidFileName(this.fileName) && this.isValidUri(this.folderUri) && !this.checkFileExists(this.fileName, this.folderUri)){ + if(this.isValidFileName(this.fileName) && this.isValidUri(this.folderUri)){ this.okButton.removeAttribute("disabled"); this.error.innerHTML=""; } @@ -141,7 +141,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { } } }else{ - if(this.error.innerHTML !== ""){ + if(this.error.innerHTML === ""){ this.showError("! Name and Location should be valid."); } //disable ok -- cgit v1.2.3