From d04aa0b195826b3b3c70f68aa8aba1be9e30a648 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 31 May 2012 10:34:59 -0700 Subject: fixing the close and save Signed-off-by: Valerio Virgillito --- .../layout/documents-tab.reel/documents-tab.js | 34 ---------------------- js/controllers/document-controller.js | 9 ++---- 2 files changed, 3 insertions(+), 40 deletions(-) (limited to 'js') diff --git a/js/components/layout/documents-tab.reel/documents-tab.js b/js/components/layout/documents-tab.reel/documents-tab.js index 0be639db..41c98b30 100755 --- a/js/components/layout/documents-tab.reel/documents-tab.js +++ b/js/components/layout/documents-tab.reel/documents-tab.js @@ -8,40 +8,6 @@ var Montage = require("montage/core/core").Montage; var Component = require("montage/ui/component").Component; exports.DocumentsTab = Montage.create(Component, { - - /* - openDocuments: { - value: [] - }, - - prepareForDraw: { - enumerable: false, - value: function() { -// console.log("Change this to be inside the Ninja Reel"); - this.openDocuments = this.application.ninja.documentController._documents; -// this.eventManager.addEventListener( "appLoaded", this, false); - } - }, - - handleAppLoaded: { - value: function() { -// this.openDocuments = this.application.ninja.currentDocument; - } - }, - - draw: { - enumerable: false, - value: function() { - - } - }, - - handleClick: { - value: function(event) { - - } - } - */ contentController: { value: null } diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index c9557a57..f85e2f97 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -150,10 +150,10 @@ exports.DocumentController = Montage.create(Component, { handleExecuteSave: { value: function(event) { // - if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ + if((typeof this.currentDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ //Currently we don't need a callback handler //this.activeDocument.model.save(this.saveExecuted.bind(this)); - this.activeDocument.model.save(); + this.currentDocument.model.save(); } else { //Error: cloud not available and/or no active document } @@ -194,16 +194,13 @@ exports.DocumentController = Montage.create(Component, { //////////////////////////////////////////////////////////////////// handleExecuteFileClose:{ value: function(event) { - if (this.activeDocument) { - this.closeFile(this.activeDocument); - } + this.closeFile(this.currentDocument); } }, //////////////////////////////////////////////////////////////////// //TODO: Is this used, should be cleaned up handleExecuteFileCloseAll:{ value: function(event) { - var i=0;//TODO: who is using this?? if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){ while(this._documents.length > 0){ this.closeDocument(this._documents[this._documents.length -1].uuid); -- cgit v1.2.3