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.js41
1 files changed, 33 insertions, 8 deletions
diff --git a/js/document/models/base.js b/js/document/models/base.js
index a3644815..5fa06259 100755
--- a/js/document/models/base.js
+++ b/js/document/models/base.js
@@ -68,12 +68,8 @@ exports.BaseDocumentModel = Montage.create(Component, {
68 //////////////////////////////////////////////////////////////////// 68 ////////////////////////////////////////////////////////////////////
69 // 69 //
70 selection: { 70 selection: {
71 get: function() { 71 get: function() {return this._selection;},
72 return this._selection; 72 set: function(value) {this._selection = value;}
73 },
74 set: function(value) {
75 this._selection = value;
76 }
77 }, 73 },
78 //////////////////////////////////////////////////////////////////// 74 ////////////////////////////////////////////////////////////////////
79 // 75 //
@@ -92,6 +88,11 @@ exports.BaseDocumentModel = Montage.create(Component, {
92 }, 88 },
93 //////////////////////////////////////////////////////////////////// 89 ////////////////////////////////////////////////////////////////////
94 // 90 //
91 libs: {
92 value: null
93 },
94 ////////////////////////////////////////////////////////////////////
95 //
95 switchViewTo: { 96 switchViewTo: {
96 value: function (view) { 97 value: function (view) {
97 // 98 //
@@ -167,8 +168,9 @@ exports.BaseDocumentModel = Montage.create(Component, {
167 // 168 //
168 if (this.currentView === this.views.design) { 169 if (this.currentView === this.views.design) {
169 // 170 //
170 this.application.ninja.ioMediator.fileSave({ 171 var save = this.application.ninja.ioMediator.fileSave({
171 mode: 'html', 172 mode: 'html',
173 libs: this.libs,
172 file: this.file, 174 file: this.file,
173 webgl: this.webGlHelper.glData, 175 webgl: this.webGlHelper.glData,
174 styles: this.getStyleSheets(), 176 styles: this.getStyleSheets(),
@@ -178,6 +180,17 @@ exports.BaseDocumentModel = Montage.create(Component, {
178 body: this.views.design.iframe.contentWindow.document.body, 180 body: this.views.design.iframe.contentWindow.document.body,
179 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator 181 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator
180 }, this.handleSaved.bind({callback: callback, model: this}), libCopyCallback); 182 }, this.handleSaved.bind({callback: callback, model: this}), libCopyCallback);
183 //TODO: Improve detection during save routine
184 if (save) {
185 if (save.montageId) {
186 this.libs.montageId = save.montageId;
187 this.libs.montage = true;
188 }
189 if (save.canvasId) {
190 this.libs.canvasId = save.canvasId;
191 this.libs.canvas = true;
192 }
193 }
181 } else { 194 } else {
182 //TODO: Add logic to save code view data 195 //TODO: Add logic to save code view data
183 } 196 }
@@ -196,8 +209,9 @@ exports.BaseDocumentModel = Montage.create(Component, {
196 // 209 //
197 if (this.currentView === this.views.design) { 210 if (this.currentView === this.views.design) {
198 // 211 //
199 this.application.ninja.ioMediator.fileSave({ 212 var save = this.application.ninja.ioMediator.fileSave({
200 mode: 'html', 213 mode: 'html',
214 libs: this.libs,
201 file: this.file, 215 file: this.file,
202 webgl: this.webGlHelper.glData, 216 webgl: this.webGlHelper.glData,
203 css: this.getStyleSheets(), 217 css: this.getStyleSheets(),
@@ -207,6 +221,17 @@ exports.BaseDocumentModel = Montage.create(Component, {
207 body: this.views.design.iframe.contentWindow.document.body, 221 body: this.views.design.iframe.contentWindow.document.body,
208 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator 222 mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator
209 }, this.handleSaved.bind({callback: callback, model: this}), libCopyCallback); 223 }, this.handleSaved.bind({callback: callback, model: this}), libCopyCallback);
224 //TODO: Improve detection during save routine
225 if (save) {
226 if (save.montageId) {
227 this.libs.montageId = save.montageId;
228 this.libs.montage = true;
229 }
230 if (save.canvasId) {
231 this.libs.canvasId = save.canvasId;
232 this.libs.canvas = true;
233 }
234 }
210 } else { 235 } else {
211 //TODO: Add logic to save code view data 236 //TODO: Add logic to save code view data
212 } 237 }