From 1fa1faf9119e4dd048bd52fd44ab754b6942c319 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Mon, 4 Jun 2012 15:32:20 -0700 Subject: Fixing saveAll from menu This was broken, not sure when it broke, but working again. --- js/controllers/document-controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/controllers/document-controller.js') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index a90375af..bb0041eb 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -174,9 +174,9 @@ exports.DocumentController = Montage.create(Component, { handleExecuteSaveAll: { value: function(event) { // - if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ + if((typeof this.currentDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ // - this.activeDocument.model.saveAll(); + this.currentDocument.model.saveAll(); } else { //TODO: Add error handling } -- cgit v1.2.3 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/controllers/document-controller.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 From 5bf88b70e5cfbc68f3d28e8ad412a98be8e55c11 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 5 Jun 2012 14:27:20 -0700 Subject: fixing the save as Signed-off-by: Valerio Virgillito --- js/controllers/document-controller.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'js/controllers/document-controller.js') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 4f2eff50..a3ebac24 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -291,19 +291,19 @@ exports.DocumentController = Montage.create(Component, { value:function(saveAsDetails){ var fileUri = null, filename = saveAsDetails.filename, destination = saveAsDetails.destination; //update document metadata - this.activeDocument.name = ""+filename; + this.currentDocument.model.file.name = ""+filename; //prepare new file uri if(destination && (destination.charAt(destination.length -1) !== "/")){ destination = destination + "/"; } fileUri = destination+filename; - this.activeDocument.uri = fileUri; + this.currentDocument.model.file.uri = fileUri; //save a new file //use the ioMediator.fileSaveAll when implemented - this.activeDocument.model.file.name = filename; - this.activeDocument.model.file.uri = fileUri; - this.activeDocument.model.save(); + this.currentDocument.model.file.name = filename; + this.currentDocument.model.file.uri = fileUri; + this.currentDocument.model.save(); } }, -- cgit v1.2.3