diff options
Diffstat (limited to 'js/document/models/base.js')
-rwxr-xr-x | js/document/models/base.js | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/js/document/models/base.js b/js/document/models/base.js index 5f2a5893..649539ea 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js | |||
@@ -93,13 +93,21 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
93 | //Currently only supporting current browser (Chrome, obviously) | 93 | //Currently only supporting current browser (Chrome, obviously) |
94 | switch (this.browser) { | 94 | switch (this.browser) { |
95 | case 'chrome': | 95 | case 'chrome': |
96 | window.open(this.url); | 96 | if (this.template && (this.template.type === 'banner' || this.template.type === 'animation')) { |
97 | window.open('/js/document/templates/preview/banner.html?width='+this.template.size.width+'&height='+this.template.size.height+'&url='+this.url); | ||
98 | } else { | ||
99 | window.open(this.url); | ||
100 | } | ||
97 | break; | 101 | break; |
98 | default: | 102 | default: |
99 | window.open(this.url); | 103 | if (this.template.type === 'banner' || this.template.type === 'animation') { |
104 | window.open('/js/document/templates/preview/banner.html?width='+this.template.size.width+'&height='+this.template.size.height+'&url='+this.url); | ||
105 | } else { | ||
106 | window.open(this.url); | ||
107 | } | ||
100 | break; | 108 | break; |
101 | } | 109 | } |
102 | }.bind({browser: browser, url: url})); | 110 | }.bind({browser: browser, url: url, template: this.fileTemplate})); |
103 | } | 111 | } |
104 | }, | 112 | }, |
105 | //////////////////////////////////////////////////////////////////// | 113 | //////////////////////////////////////////////////////////////////// |
@@ -141,7 +149,8 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
141 | template: this.fileTemplate, | 149 | template: this.fileTemplate, |
142 | document: this.views.design.iframe.contentWindow.document, | 150 | document: this.views.design.iframe.contentWindow.document, |
143 | head: this.views.design.iframe.contentWindow.document.head, | 151 | head: this.views.design.iframe.contentWindow.document.head, |
144 | 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 | ||
145 | }, callback.bind(this)); | 154 | }, callback.bind(this)); |
146 | } else { | 155 | } else { |
147 | //TODO: Add logic to save code view data | 156 | //TODO: Add logic to save code view data |
@@ -169,7 +178,8 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
169 | template: this.fileTemplate, | 178 | template: this.fileTemplate, |
170 | document: this.views.design.iframe.contentWindow.document, | 179 | document: this.views.design.iframe.contentWindow.document, |
171 | head: this.views.design.iframe.contentWindow.document.head, | 180 | head: this.views.design.iframe.contentWindow.document.head, |
172 | 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 | ||
173 | }, callback.bind(this)); | 183 | }, callback.bind(this)); |
174 | } else { | 184 | } else { |
175 | //TODO: Add logic to save code view data | 185 | //TODO: Add logic to save code view data |
@@ -206,10 +216,11 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
206 | if (this.views.design && (!view || view === 'design')) { | 216 | if (this.views.design && (!view || view === 'design')) { |
207 | // | 217 | // |
208 | this.parentContainer.removeChild(this.views.design.iframe); | 218 | this.parentContainer.removeChild(this.views.design.iframe); |
219 | this.views.design.pauseAndStopVideos(); | ||
209 | this.views.design = null; | 220 | this.views.design = null; |
210 | } | 221 | } |
211 | // | 222 | // |
212 | if (callback) callback(success); | 223 | return success; |
213 | } | 224 | } |
214 | } | 225 | } |
215 | //////////////////////////////////////////////////////////////////// | 226 | //////////////////////////////////////////////////////////////////// |