diff options
Diffstat (limited to 'js/document/views')
-rwxr-xr-x | js/document/views/design.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/js/document/views/design.js b/js/document/views/design.js index e838dd49..4c91ff39 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js | |||
@@ -159,8 +159,9 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
159 | insertBannerContent: { | 159 | insertBannerContent: { |
160 | value: function (e) { | 160 | value: function (e) { |
161 | //Getting first element in DOM (assumes it's root) | 161 | //Getting first element in DOM (assumes it's root) |
162 | var banner = this._bodyFragment.getElementsByTagName('*')[1], | 162 | //TODO: Ensure wrapper logic is proper |
163 | ninjaBanner = this.document.body.getElementsByTagName('ninja-banner')[0]; | 163 | var banner = this._bodyFragment.getElementsByTagName('*')[2], |
164 | ninjaBanner = this.document.body.getElementsByTagName('ninja-content')[0]; | ||
164 | //Copying attributes to maintain same properties as the banner root | 165 | //Copying attributes to maintain same properties as the banner root |
165 | for (var n in banner.attributes) { | 166 | for (var n in banner.attributes) { |
166 | if (banner.attributes[n].value) { | 167 | if (banner.attributes[n].value) { |
@@ -168,7 +169,8 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
168 | } | 169 | } |
169 | } | 170 | } |
170 | //Adjusting margin per size of document | 171 | //Adjusting margin per size of document |
171 | this.document.head.getElementsByTagName('style')[0].innerHTML += '\n ninja-banner {margin-top: -'+Math.floor(this._template.size.height/2)+'px; margin-left: -'+Math.floor(this._template.size.width/2)+'px}'; | 172 | //this.document.head.getElementsByTagName('style')[0].innerHTML += '\n ninja-banner {overflow: visible !important; margin-top: -'+Math.floor(this._template.size.height/2)+'px; margin-left: -'+Math.floor(this._template.size.width/2)+'px}'; |
173 | this.document.head.getElementsByTagName('style')[0].innerHTML += '\n ninja-content {overflow: visible !important;} ninja-content, ninja-viewport {width: ' + this._template.size.width + 'px; height: ' + this._template.size.height + 'px;}'; | ||
172 | //Setting content in template | 174 | //Setting content in template |
173 | ninjaBanner.innerHTML = banner.innerHTML; | 175 | ninjaBanner.innerHTML = banner.innerHTML; |
174 | //Garbage collection | 176 | //Garbage collection |