aboutsummaryrefslogtreecommitdiff
path: root/js/document/models
diff options
context:
space:
mode:
Diffstat (limited to 'js/document/models')
-rwxr-xr-xjs/document/models/base.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/js/document/models/base.js b/js/document/models/base.js
index 0f58e75c..f9844b70 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.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 ////////////////////////////////////////////////////////////////////
@@ -138,6 +146,7 @@ exports.BaseDocumentModel = Montage.create(Component, {
138 file: this.file, 146 file: this.file,
139 webgl: this.webGlHelper.glData, 147 webgl: this.webGlHelper.glData,
140 styles: this.getStyleSheets(), 148 styles: this.getStyleSheets(),
149 template: this.fileTemplate,
141 document: this.views.design.iframe.contentWindow.document, 150 document: this.views.design.iframe.contentWindow.document,
142 head: this.views.design.iframe.contentWindow.document.head, 151 head: this.views.design.iframe.contentWindow.document.head,
143 body: this.views.design.iframe.contentWindow.document.body 152 body: this.views.design.iframe.contentWindow.document.body
@@ -165,6 +174,7 @@ exports.BaseDocumentModel = Montage.create(Component, {
165 file: this.file, 174 file: this.file,
166 webgl: this.webGlHelper.glData, 175 webgl: this.webGlHelper.glData,
167 css: this.getStyleSheets(), 176 css: this.getStyleSheets(),
177 template: this.fileTemplate,
168 document: this.views.design.iframe.contentWindow.document, 178 document: this.views.design.iframe.contentWindow.document,
169 head: this.views.design.iframe.contentWindow.document.head, 179 head: this.views.design.iframe.contentWindow.document.head,
170 body: this.views.design.iframe.contentWindow.document.body 180 body: this.views.design.iframe.contentWindow.document.body
@@ -204,10 +214,11 @@ exports.BaseDocumentModel = Montage.create(Component, {
204 if (this.views.design && (!view || view === 'design')) { 214 if (this.views.design && (!view || view === 'design')) {
205 // 215 //
206 this.parentContainer.removeChild(this.views.design.iframe); 216 this.parentContainer.removeChild(this.views.design.iframe);
217 this.views.design.pauseAndStopVideos();
207 this.views.design = null; 218 this.views.design = null;
208 } 219 }
209 // 220 //
210 if (callback) callback(success); 221 return success;
211 } 222 }
212 } 223 }
213 //////////////////////////////////////////////////////////////////// 224 ////////////////////////////////////////////////////////////////////