aboutsummaryrefslogtreecommitdiff
path: root/js/components/layout
diff options
context:
space:
mode:
Diffstat (limited to 'js/components/layout')
-rwxr-xr-xjs/components/layout/document-bar.reel/document-bar.js35
1 files changed, 21 insertions, 14 deletions
diff --git a/js/components/layout/document-bar.reel/document-bar.js b/js/components/layout/document-bar.reel/document-bar.js
index 77f05bc1..bf84c652 100755
--- a/js/components/layout/document-bar.reel/document-bar.js
+++ b/js/components/layout/document-bar.reel/document-bar.js
@@ -233,23 +233,30 @@ exports.DocumentBar = Montage.create(Component, {
233 value: function (view, render, aBtn, iBtn) { 233 value: function (view, render, aBtn, iBtn) {
234 //TODO: Remove reference to string view 234 //TODO: Remove reference to string view
235 if (this._currentDocument.model.currentView !== view) { 235 if (this._currentDocument.model.currentView !== view) {
236 // 236 var doc;
237 //Switching view and changing button modes
237 this._currentDocument.model.switchViewTo(view); 238 this._currentDocument.model.switchViewTo(view);
238 iBtn.setAttribute('class', 'inactive'); 239 iBtn.setAttribute('class', 'inactive');
239 aBtn.removeAttribute('class'); 240 aBtn.removeAttribute('class');
240 //TODO: Add document parsing to reload view 241 //Checking for view to get other view document (object to code and string to design)
241 this._currentDocument.reloadView(view, this.fileTemplate, { 242 if (view === 'code') {
242 mode: 'html', 243 doc = {
243 libs: this._currentDocument.model.libs, 244 mode: 'html',
244 file: this._currentDocument.model.file, 245 libs: this._currentDocument.model.libs,
245 webgl: this._currentDocument.model.webGlHelper.glData, 246 file: this._currentDocument.model.file,
246 styles: this._currentDocument.model.getStyleSheets(), 247 webgl: this._currentDocument.model.webGlHelper.glData,
247 template: this._currentDocument.fileTemplate, 248 styles: this._currentDocument.model.getStyleSheets(),
248 document: this._currentDocument.model.views.design.iframe.contentWindow.document, 249 template: this._currentDocument.fileTemplate,
249 head: this._currentDocument.model.views.design.iframe.contentWindow.document.head, 250 document: this._currentDocument.model.views.design.iframe.contentWindow.document,
250 body: this._currentDocument.model.views.design.iframe.contentWindow.document.body, 251 head: this._currentDocument.model.views.design.iframe.contentWindow.document.head,
251 mjsTemplateCreator: this._currentDocument.model.views.design.iframe.contentWindow.mjsTemplateCreator 252 body: this._currentDocument.model.views.design.iframe.contentWindow.document.body,
252 }); 253 mjsTemplateCreator: this._currentDocument.model.views.design.iframe.contentWindow.mjsTemplateCreator
254 }
255 } else if (view === 'design') {
256 doc = this._currentDocument.model.views.code.textArea.value;
257 }
258 //Reloading the document from changes made
259 this._currentDocument.reloadView(view, this.fileTemplate, doc);
253 } 260 }
254 } 261 }
255 }, 262 },