From 6372f7acc7e1d9fd6aa93e4afd476ac882a34ecd Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 5 Jun 2012 14:07:06 -0700 Subject: fixing the save as Signed-off-by: Valerio Virgillito --- js/controllers/document-controller.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'js') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index bb0041eb..4f2eff50 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -186,9 +186,9 @@ exports.DocumentController = Montage.create(Component, { handleExecuteSaveAs: { value: function(event) { var saveAsSettings = event._event.settings || {}; - if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ - saveAsSettings.fileName = this.activeDocument.model.file.name; - saveAsSettings.folderUri = this.activeDocument.model.file.uri.substring(0, this.activeDocument.model.file.uri.lastIndexOf("/")); + if((typeof this.currentDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ + saveAsSettings.fileName = this.currentDocument.model.file.name; + saveAsSettings.folderUri = this.currentDocument.model.file.uri.substring(0, this.currentDocument.model.file.uri.lastIndexOf("/")); saveAsSettings.callback = this.saveAsCallback.bind(this); this.application.ninja.newFileController.showSaveAsDialog(saveAsSettings); } @@ -204,9 +204,9 @@ exports.DocumentController = Montage.create(Component, { //TODO: Is this used, should be cleaned up handleExecuteFileCloseAll:{ value: function(event) { - if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){ - while(this._documents.length > 0){ - this.closeDocument(this._documents[this._documents.length -1].uuid); + if(this.currentDocument && this.application.ninja.coreIoApi.cloudAvailable()){ + while(this.currentDocument.length > 0){ + this.closeDocument(this.currentDocument[this.currentDocument.length -1].uuid); } } } -- cgit v1.2.3