diff options
author | Jose Antonio Marquez | 2012-06-07 14:44:10 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-06-07 14:44:10 -0700 |
commit | 1698e3b0c99ff972da61d915074f1f7f1646f641 (patch) | |
tree | ba290cfdf6e8cd675eb23ed7daab86439172c4f1 /js/document/views | |
parent | 8da49b093e01a62c5b2009da075c2ccd2b1b6f5a (diff) | |
download | ninja-1698e3b0c99ff972da61d915074f1f7f1646f641.tar.gz |
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.
Diffstat (limited to 'js/document/views')
-rwxr-xr-x | js/document/views/design.js | 14 |
1 files changed, 13 insertions, 1 deletions
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, { | |||
204 | this.document.body.setAttribute(this.content.document.body.attributes[n].name, this.content.document.body.attributes[n].value); | 204 | this.document.body.setAttribute(this.content.document.body.attributes[n].name, this.content.document.body.attributes[n].value); |
205 | } | 205 | } |
206 | } | 206 | } |
207 | //TODO: Add attribute copying for <HEAD> and <HTML> | 207 | //Copying attributes to maintain same properties as the <head> |
208 | for (var m in this.content.document.head.attributes) { | ||
209 | if (this.content.document.head.attributes[m].value) { | ||
210 | this.document.head.setAttribute(this.content.document.head.attributes[m].name, this.content.document.head.attributes[m].value); | ||
211 | } | ||
212 | } | ||
213 | //Copying attributes to maintain same properties as the <html> | ||
214 | var htmlTagMem = this.content.document.getElementsByTagName('html')[0], htmlTagDoc = this.document.getElementsByTagName('html')[0]; | ||
215 | for (var m in htmlTagMem.attributes) { | ||
216 | if (htmlTagMem.attributes[m].value) { | ||
217 | htmlTagDoc.setAttribute(htmlTagMem.attributes[m].name, htmlTagMem.attributes[m].value); | ||
218 | } | ||
219 | } | ||
208 | } | 220 | } |
209 | } | 221 | } |
210 | }, | 222 | }, |