aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-31 10:34:59 -0700
committerValerio Virgillito2012-05-31 10:34:59 -0700
commitd04aa0b195826b3b3c70f68aa8aba1be9e30a648 (patch)
treefdc55a4785b975b11e6421362f86edae176dcdfa
parente1fe603a7c002073f8ac13623f8cc8dc43efb59d (diff)
downloadninja-d04aa0b195826b3b3c70f68aa8aba1be9e30a648.tar.gz
fixing the close and save
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
-rwxr-xr-xjs/components/layout/documents-tab.reel/documents-tab.js34
-rwxr-xr-xjs/controllers/document-controller.js9
2 files changed, 3 insertions, 40 deletions
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;
8var Component = require("montage/ui/component").Component; 8var Component = require("montage/ui/component").Component;
9 9
10exports.DocumentsTab = Montage.create(Component, { 10exports.DocumentsTab = Montage.create(Component, {
11
12 /*
13 openDocuments: {
14 value: []
15 },
16
17 prepareForDraw: {
18 enumerable: false,
19 value: function() {
20// console.log("Change this to be inside the Ninja Reel");
21 this.openDocuments = this.application.ninja.documentController._documents;
22// this.eventManager.addEventListener( "appLoaded", this, false);
23 }
24 },
25
26 handleAppLoaded: {
27 value: function() {
28// this.openDocuments = this.application.ninja.currentDocument;
29 }
30 },
31
32 draw: {
33 enumerable: false,
34 value: function() {
35
36 }
37 },
38
39 handleClick: {
40 value: function(event) {
41
42 }
43 }
44 */
45 contentController: { 11 contentController: {
46 value: null 12 value: null
47 } 13 }
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, {
150 handleExecuteSave: { 150 handleExecuteSave: {
151 value: function(event) { 151 value: function(event) {
152 // 152 //
153 if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ 153 if((typeof this.currentDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){
154 //Currently we don't need a callback handler 154 //Currently we don't need a callback handler
155 //this.activeDocument.model.save(this.saveExecuted.bind(this)); 155 //this.activeDocument.model.save(this.saveExecuted.bind(this));
156 this.activeDocument.model.save(); 156 this.currentDocument.model.save();
157 } else { 157 } else {
158 //Error: cloud not available and/or no active document 158 //Error: cloud not available and/or no active document
159 } 159 }
@@ -194,16 +194,13 @@ exports.DocumentController = Montage.create(Component, {
194 //////////////////////////////////////////////////////////////////// 194 ////////////////////////////////////////////////////////////////////
195 handleExecuteFileClose:{ 195 handleExecuteFileClose:{
196 value: function(event) { 196 value: function(event) {
197 if (this.activeDocument) { 197 this.closeFile(this.currentDocument);
198 this.closeFile(this.activeDocument);
199 }
200 } 198 }
201 }, 199 },
202 //////////////////////////////////////////////////////////////////// 200 ////////////////////////////////////////////////////////////////////
203 //TODO: Is this used, should be cleaned up 201 //TODO: Is this used, should be cleaned up
204 handleExecuteFileCloseAll:{ 202 handleExecuteFileCloseAll:{
205 value: function(event) { 203 value: function(event) {
206 var i=0;//TODO: who is using this??
207 if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){ 204 if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){
208 while(this._documents.length > 0){ 205 while(this._documents.length > 0){
209 this.closeDocument(this._documents[this._documents.length -1].uuid); 206 this.closeDocument(this._documents[this._documents.length -1].uuid);