aboutsummaryrefslogtreecommitdiff
path: root/js/document/views/design.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-14 17:20:01 -0700
committerValerio Virgillito2012-05-14 17:20:01 -0700
commitaeb15b43b92dc38bb04ef5dac72111383f044ec5 (patch)
treee72b6ca1c7e419291f5b088b60c6f05693d3f264 /js/document/views/design.js
parent835df7fcacda5137f0953892e467e5a84f775b35 (diff)
parent150b6eb2be526627d588a0cf7226ddad7a399b8f (diff)
downloadninja-aeb15b43b92dc38bb04ef5dac72111383f044ec5.tar.gz
Merge pull request #228 from joseeight/Document
Document Banner Template
Diffstat (limited to 'js/document/views/design.js')
-rwxr-xr-xjs/document/views/design.js7
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