aboutsummaryrefslogtreecommitdiff
path: root/js/document/models
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-18 16:36:07 -0700
committerValerio Virgillito2012-05-18 16:36:07 -0700
commite7c288fe8f5d3a9e5c9f0eb0a045c6c195a0e7b8 (patch)
tree0b0ac15a0dd11a5996bd0c357693df62d1029669 /js/document/models
parentfdfba499f0b84360b96096fa866a981e96e8756c (diff)
parent1056a45e0cbf92d578324ce70b8a17183320e64b (diff)
downloadninja-e7c288fe8f5d3a9e5c9f0eb0a045c6c195a0e7b8.tar.gz
Merge branch 'dom-architecture' of github.com:Motorola-Mobility/ninja-internal into dom-architecture
Diffstat (limited to 'js/document/models')
-rwxr-xr-xjs/document/models/base.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/js/document/models/base.js b/js/document/models/base.js
index df341b2f..c99e36c7 100755
--- a/js/document/models/base.js
+++ b/js/document/models/base.js
@@ -151,7 +151,7 @@ exports.BaseDocumentModel = Montage.create(Component, {
151 head: this.views.design.iframe.contentWindow.document.head, 151 head: this.views.design.iframe.contentWindow.document.head,
152 body: this.views.design.iframe.contentWindow.document.body, 152 body: this.views.design.iframe.contentWindow.document.body,
153 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator 153 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator
154 }, callback.bind(this)); 154 }, this.handleSaved.bind({callback: callback, model: this}));
155 } else { 155 } else {
156 //TODO: Add logic to save code view data 156 //TODO: Add logic to save code view data
157 } 157 }
@@ -180,7 +180,7 @@ exports.BaseDocumentModel = Montage.create(Component, {
180 head: this.views.design.iframe.contentWindow.document.head, 180 head: this.views.design.iframe.contentWindow.document.head,
181 body: this.views.design.iframe.contentWindow.document.body, 181 body: this.views.design.iframe.contentWindow.document.body,
182 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator 182 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator
183 }, callback.bind(this)); 183 }, this.handleSaved.bind({callback: callback, model: this}));
184 } else { 184 } else {
185 //TODO: Add logic to save code view data 185 //TODO: Add logic to save code view data
186 } 186 }
@@ -190,7 +190,7 @@ exports.BaseDocumentModel = Montage.create(Component, {
190 //////////////////////////////////////////////////////////////////// 190 ////////////////////////////////////////////////////////////////////
191 // 191 //
192 saveAs: { 192 saveAs: {
193 value: function () { 193 value: function (callback) {
194 // 194 //
195 if (this.needsSave) { 195 if (this.needsSave) {
196 //Save current file on memory 196 //Save current file on memory
@@ -201,6 +201,18 @@ exports.BaseDocumentModel = Montage.create(Component, {
201 }, 201 },
202 //////////////////////////////////////////////////////////////////// 202 ////////////////////////////////////////////////////////////////////
203 // 203 //
204 handleSaved: {
205 value: function (result) {
206 //
207 if (result.status === 204) {
208 this.model.needsSave = false;
209 }
210 //
211 if (this.callback) this.callback(result);
212 }
213 },
214 ////////////////////////////////////////////////////////////////////
215 //
204 close: { 216 close: {
205 value: function (view, callback) { 217 value: function (view, callback) {
206 //Outcome of close (pending on save logic) 218 //Outcome of close (pending on save logic)