diff options
author | Valerio Virgillito | 2012-05-18 15:43:30 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-18 15:43:30 -0700 |
commit | 1056a45e0cbf92d578324ce70b8a17183320e64b (patch) | |
tree | 826a7149a65b5160e1c6bf64d33aef2f126b1d00 /js/controllers/document-controller.js | |
parent | 66edf78c7e5df11218ef733686965beab05c7c7d (diff) | |
parent | d878aa470074d5698a316512b513949fa22073f2 (diff) | |
download | ninja-1056a45e0cbf92d578324ce70b8a17183320e64b.tar.gz |
Merge pull request #246 from joseeight/Document
Fixing Save Logic
Diffstat (limited to 'js/controllers/document-controller.js')
-rwxr-xr-x | js/controllers/document-controller.js | 15 |
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 | //////////////////////////////////////////////////////////////////// |