aboutsummaryrefslogtreecommitdiff
path: root/js/document/mediators
diff options
context:
space:
mode:
Diffstat (limited to 'js/document/mediators')
-rwxr-xr-xjs/document/mediators/template.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/js/document/mediators/template.js b/js/document/mediators/template.js
index 0d48355f..e770e07f 100755
--- a/js/document/mediators/template.js
+++ b/js/document/mediators/template.js
@@ -145,6 +145,14 @@ exports.TemplateDocumentMediator = Montage.create(Component, {
145 template.file.content.document.body.setAttribute(template.body.attributes[n].name, template.body.attributes[n].value); 145 template.file.content.document.body.setAttribute(template.body.attributes[n].name, template.body.attributes[n].value);
146 } 146 }
147 } 147 }
148 //
149 if (template.body && template.body.getAttribute('data-ninja-style') !== null) {
150 template.file.content.document.body.setAttribute('style', template.body.getAttribute('data-ninja-style'));
151 template.file.content.document.body.removeAttribute('data-ninja-style');
152 } else if (template.body && template.body.getAttribute('data-ninja-style') === null) {
153 template.file.content.document.body.removeAttribute('style');
154 template.file.content.document.body.removeAttribute('data-ninja-style');
155 }
148 wipeAttributes(template.file.content.document.head); 156 wipeAttributes(template.file.content.document.head);
149 //Copying attributes to maintain same properties as the <head> 157 //Copying attributes to maintain same properties as the <head>
150 for (var m in template.document.head.attributes) { 158 for (var m in template.document.head.attributes) {
@@ -182,14 +190,6 @@ exports.TemplateDocumentMediator = Montage.create(Component, {
182 //Removing attribute 190 //Removing attribute
183 presentNodes[n].removeAttribute('data-ninja-node'); 191 presentNodes[n].removeAttribute('data-ninja-node');
184 } 192 }
185 //
186 if (presentNodes[n].getAttribute && presentNodes[n].getAttribute('data-ninja-style') !== null) {
187 presentNodes[n].setAttribute('style', presentNodes[n].getAttribute('data-ninja-style'));
188 presentNodes[n].removeAttribute('data-ninja-style');
189 } else if (presentNodes[n].getAttribute && presentNodes[n].getAttribute('data-ninja-style') === null) {
190 presentNodes[n].removeAttribute('style');
191 presentNodes[n].removeAttribute('data-ninja-style');
192 }
193 } 193 }
194 //Getting all CSS (style or link) tags 194 //Getting all CSS (style or link) tags
195 var styletags = template.file.content.document.getElementsByTagName('style'), 195 var styletags = template.file.content.document.getElementsByTagName('style'),