diff options
author | Jose Antonio Marquez | 2012-08-06 10:29:47 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-08-06 10:29:47 -0700 |
commit | c00ba985a16ca0a229089243c6e04280cbff758c (patch) | |
tree | 5dadbd58766a43b290dba2e3f569e1326b35af9a /js/document | |
parent | 9c3e71de8b49dd31c171921184c9baaa7955d586 (diff) | |
download | ninja-c00ba985a16ca0a229089243c6e04280cbff758c.tar.gz |
Fix: Added support for code/design view switching for banner templates
Fixed a bug with toggling views on banner templates, I was not handling meta data correctly nor parsing the document between the switching. This is a temp fix, should be better implement when dynamic sizing is added to the templates.
Diffstat (limited to 'js/document')
-rwxr-xr-x | js/document/document-html.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/js/document/document-html.js b/js/document/document-html.js index f3163339..d610c69d 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js | |||
@@ -157,6 +157,14 @@ exports.HtmlDocument = Montage.create(Component, { | |||
157 | this.model.views.design.show(); | 157 | this.model.views.design.show(); |
158 | this.model.views.design.iframe.style.opacity = 0; | 158 | this.model.views.design.iframe.style.opacity = 0; |
159 | this.model.views.design.content = this.application.ninja.ioMediator.tmplt.parseHtmlToNinjaTemplate(doc); | 159 | this.model.views.design.content = this.application.ninja.ioMediator.tmplt.parseHtmlToNinjaTemplate(doc); |
160 | // | ||
161 | if (!template) { | ||
162 | if (this.model.views.design.content.body.indexOf('Ninja-Banner Dimensions@@@') !== -1) { | ||
163 | dimensions = (this.model.views.design.content.body.split('Ninja-Banner Dimensions@@@'))[1].split('-->')[0].split('x'); | ||
164 | dimensions = {width: parseInt(dimensions[0]), height: parseInt(dimensions[1])}; | ||
165 | template = {type: 'banner', size: dimensions}; | ||
166 | } | ||
167 | } | ||
160 | //TODO: Improve reference (probably through binding values) | 168 | //TODO: Improve reference (probably through binding values) |
161 | this.model.views.design._webGlHelper = this.model.webGlHelper; | 169 | this.model.views.design._webGlHelper = this.model.webGlHelper; |
162 | //Rendering design view, using observers to know when template is ready | 170 | //Rendering design view, using observers to know when template is ready |