aboutsummaryrefslogtreecommitdiff
path: root/js/document/models/base.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/document/models/base.js')
-rwxr-xr-xjs/document/models/base.js33
1 files changed, 31 insertions, 2 deletions
diff --git a/js/document/models/base.js b/js/document/models/base.js
index a3644815..c69c54a9 100755
--- a/js/document/models/base.js
+++ b/js/document/models/base.js
@@ -92,6 +92,11 @@ exports.BaseDocumentModel = Montage.create(Component, {
92 }, 92 },
93 //////////////////////////////////////////////////////////////////// 93 ////////////////////////////////////////////////////////////////////
94 // 94 //
95 libs: {
96 value: {montage: false, canvas: false, montageId: null, canvasId: null}
97 },
98 ////////////////////////////////////////////////////////////////////
99 //
95 switchViewTo: { 100 switchViewTo: {
96 value: function (view) { 101 value: function (view) {
97 // 102 //
@@ -167,8 +172,9 @@ exports.BaseDocumentModel = Montage.create(Component, {
167 // 172 //
168 if (this.currentView === this.views.design) { 173 if (this.currentView === this.views.design) {
169 // 174 //
170 this.application.ninja.ioMediator.fileSave({ 175 var save = this.application.ninja.ioMediator.fileSave({
171 mode: 'html', 176 mode: 'html',
177 libs: this.libs,
172 file: this.file, 178 file: this.file,
173 webgl: this.webGlHelper.glData, 179 webgl: this.webGlHelper.glData,
174 styles: this.getStyleSheets(), 180 styles: this.getStyleSheets(),
@@ -178,6 +184,17 @@ exports.BaseDocumentModel = Montage.create(Component, {
178 body: this.views.design.iframe.contentWindow.document.body, 184 body: this.views.design.iframe.contentWindow.document.body,
179 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator 185 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator
180 }, this.handleSaved.bind({callback: callback, model: this}), libCopyCallback); 186 }, this.handleSaved.bind({callback: callback, model: this}), libCopyCallback);
187 //TODO: Improve detection during save routine
188 if (save) {
189 if (save.montageId) {
190 this.libs.montageId = save.montageId;
191 this.libs.montage = true;
192 }
193 if (save.canvasId) {
194 this.libs.canvasId = save.canvasId;
195 this.libs.canvas = true;
196 }
197 }
181 } else { 198 } else {
182 //TODO: Add logic to save code view data 199 //TODO: Add logic to save code view data
183 } 200 }
@@ -196,8 +213,9 @@ exports.BaseDocumentModel = Montage.create(Component, {
196 // 213 //
197 if (this.currentView === this.views.design) { 214 if (this.currentView === this.views.design) {
198 // 215 //
199 this.application.ninja.ioMediator.fileSave({ 216 var save = this.application.ninja.ioMediator.fileSave({
200 mode: 'html', 217 mode: 'html',
218 libs: this.libs,
201 file: this.file, 219 file: this.file,
202 webgl: this.webGlHelper.glData, 220 webgl: this.webGlHelper.glData,
203 css: this.getStyleSheets(), 221 css: this.getStyleSheets(),
@@ -207,6 +225,17 @@ exports.BaseDocumentModel = Montage.create(Component, {
207 body: this.views.design.iframe.contentWindow.document.body, 225 body: this.views.design.iframe.contentWindow.document.body,
208 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator 226 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator
209 }, this.handleSaved.bind({callback: callback, model: this}), libCopyCallback); 227 }, this.handleSaved.bind({callback: callback, model: this}), libCopyCallback);
228 //TODO: Improve detection during save routine
229 if (save) {
230 if (save.montageId) {
231 this.libs.montageId = save.montageId;
232 this.libs.montage = true;
233 }
234 if (save.canvasId) {
235 this.libs.canvasId = save.canvasId;
236 this.libs.canvas = true;
237 }
238 }
210 } else { 239 } else {
211 //TODO: Add logic to save code view data 240 //TODO: Add logic to save code view data
212 } 241 }