aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/document-controller.js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-05-18 15:23:15 -0700
committerJose Antonio Marquez2012-05-18 15:23:15 -0700
commitd878aa470074d5698a316512b513949fa22073f2 (patch)
tree826a7149a65b5160e1c6bf64d33aef2f126b1d00 /js/controllers/document-controller.js
parent615ec16fb7e3f7da9f0718a26d8242682ab1f588 (diff)
downloadninja-d878aa470074d5698a316512b513949fa22073f2.tar.gz
Fixing save logic
Moved dirty marker clearing code to model.
Diffstat (limited to 'js/controllers/document-controller.js')
-rwxr-xr-xjs/controllers/document-controller.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index f1523d87..cf618360 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -145,18 +145,19 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
145 value: function(event) { 145 value: function(event) {
146 // 146 //
147 if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ 147 if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){
148 // 148 //Currently we don't need a callback handler
149 this.activeDocument.model.save(this.testCallback.bind(this)); //this.fileSaveResult.bind(this) 149 //this.activeDocument.model.save(this.saveExecuted.bind(this));
150 this.activeDocument.model.save();
150 } else { 151 } else {
151 //Error: 152 //Error: cloud not available and/or no active document
152 } 153 }
153 } 154 }
154 }, 155 },
155 testCallback: { 156 ////////////////////////////////////////////////////////////////////
157 //
158 saveExecuted: {
156 value: function (value) { 159 value: function (value) {
157 console.log(value); 160 //File saved, any callbacks or events should go here
158 //TODO: Move this to the model.save()
159 this.activeDocument.model.needsSave = false;
160 } 161 }
161 }, 162 },
162 //////////////////////////////////////////////////////////////////// 163 ////////////////////////////////////////////////////////////////////