From 1698e3b0c99ff972da61d915074f1f7f1646f641 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 7 Jun 2012 14:44:10 -0700 Subject: Adding support for html and head tags attributes Both on open and close, Chrome randomly changes order of attributes, so this is browser induced bug. --- js/document/views/design.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'js/document/views/design.js') diff --git a/js/document/views/design.js b/js/document/views/design.js index 3d11e138..1a5b071e 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js @@ -204,7 +204,19 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { this.document.body.setAttribute(this.content.document.body.attributes[n].name, this.content.document.body.attributes[n].value); } } - //TODO: Add attribute copying for and + //Copying attributes to maintain same properties as the + for (var m in this.content.document.head.attributes) { + if (this.content.document.head.attributes[m].value) { + this.document.head.setAttribute(this.content.document.head.attributes[m].name, this.content.document.head.attributes[m].value); + } + } + //Copying attributes to maintain same properties as the + var htmlTagMem = this.content.document.getElementsByTagName('html')[0], htmlTagDoc = this.document.getElementsByTagName('html')[0]; + for (var m in htmlTagMem.attributes) { + if (htmlTagMem.attributes[m].value) { + htmlTagDoc.setAttribute(htmlTagMem.attributes[m].name, htmlTagMem.attributes[m].value); + } + } } } }, -- cgit v1.2.3