diff options
author | Jose Antonio Marquez | 2012-05-14 16:35:09 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-05-14 16:35:09 -0700 |
commit | 150b6eb2be526627d588a0cf7226ddad7a399b8f (patch) | |
tree | e72b6ca1c7e419291f5b088b60c6f05693d3f264 /js/document/views/design.js | |
parent | 835df7fcacda5137f0953892e467e5a84f775b35 (diff) | |
download | ninja-150b6eb2be526627d588a0cf7226ddad7a399b8f.tar.gz |
Fixing banner template
Need to implement save, but this cover open and new.
Diffstat (limited to 'js/document/views/design.js')
-rwxr-xr-x | js/document/views/design.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/js/document/views/design.js b/js/document/views/design.js index 3378ad71..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) { |
@@ -169,7 +170,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
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 {overflow: visible !important; 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}'; |
172 | this.document.head.getElementsByTagName('style')[0].innerHTML += '\n ninja-banner {overflow: visible !important;} ninja-banner, ninja-viewport {width: ' + this._template.size.width + 'px; height: ' + this._template.size.height + '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;}'; |
173 | //Setting content in template | 174 | //Setting content in template |
174 | ninjaBanner.innerHTML = banner.innerHTML; | 175 | ninjaBanner.innerHTML = banner.innerHTML; |
175 | //Garbage collection | 176 | //Garbage collection |