aboutsummaryrefslogtreecommitdiff
path: root/js/document/views
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-06-14 22:11:39 -0700
committerNivesh Rajbhandari2012-06-14 22:11:39 -0700
commit965557ffb8e11918ebc1215738a8a9657a172a84 (patch)
tree7267472ab7b6d8fb89e237d1bfed4eada80292a0 /js/document/views
parentb39e13b9a53e6c75f4f9364e686dc90df02b09bb (diff)
downloadninja-965557ffb8e11918ebc1215738a8a9657a172a84.tar.gz
Remove ninja's author-time styles for banner and animation templates on publish/save.
Missed the banner and animation case in the previous checkin. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/document/views')
-rwxr-xr-xjs/document/views/design.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/js/document/views/design.js b/js/document/views/design.js
index 325259ea..44c61617 100755
--- a/js/document/views/design.js
+++ b/js/document/views/design.js
@@ -281,7 +281,6 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
281 this.document.body.removeChild(this.document.getElementsByTagName('ninjaloadinghack')[0]); 281 this.document.body.removeChild(this.document.getElementsByTagName('ninjaloadinghack')[0]);
282 //Getting style and link tags in document 282 //Getting style and link tags in document
283 var htags = this.document.getElementsByTagName('html'), 283 var htags = this.document.getElementsByTagName('html'),
284 btags = this.document.getElementsByTagName('body'),
285 userStyles, 284 userStyles,
286 stags = this.document.getElementsByTagName('style'), 285 stags = this.document.getElementsByTagName('style'),
287 ltags = this.document.getElementsByTagName('link'), i, orgNodes, 286 ltags = this.document.getElementsByTagName('link'), i, orgNodes,
@@ -339,18 +338,18 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
339 if (orgNodes[n].getAttribute) orgNodes[n].setAttribute('data-ninja-node', 'true'); 338 if (orgNodes[n].getAttribute) orgNodes[n].setAttribute('data-ninja-node', 'true');
340 } 339 }
341 340
342 // Save initial HTML and Body style attributes so we don't override them on save 341 // Save initial HTML and Body/ninja-content style attributes so we don't override them on save
343 if(htags.length) { 342 if(htags.length) {
344 if(userStyles = htags[0].getAttribute('style')) { 343 if(userStyles = htags[0].getAttribute('style')) {
345 htags[0].setAttribute('data-ninja-style', userStyles); 344 htags[0].setAttribute('data-ninja-style', userStyles);
346 } 345 }
347 } 346 }
348 if(btags.length) { 347 if(this.documentRoot) {
349 if(userStyles = btags[0].getAttribute('style')) { 348 if(userStyles = this.documentRoot.getAttribute('style')) {
350 btags[0].setAttribute('data-ninja-style', userStyles); 349 this.documentRoot.setAttribute('data-ninja-style', userStyles);
351 } 350 }
352 } 351 }
353 //Makign callback if specified 352 //Making callback if specified
354 if (this._callback) this._callback(); 353 if (this._callback) this._callback();
355 } 354 }
356 }, 355 },