diff options
author | Armen Kesablyan | 2012-06-19 01:03:59 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-19 01:03:59 -0700 |
commit | 2e13a73e4ee980a6f73f6ff48b2a195eb209a7db (patch) | |
tree | d352f5e769eae0e1b7b76ccbeafa9b174b1a9918 /js/document/views | |
parent | 244e608645778746d1a3b5aa0d4c0868f7c5c272 (diff) | |
parent | c59eb371559a3061ce53223e249ca97daace5968 (diff) | |
download | ninja-2e13a73e4ee980a6f73f6ff48b2a195eb209a7db.tar.gz |
Merge branch 'refs/heads/master' into binding
Conflicts:
js/components/layout/tools-list.reel/tools-list.html
js/components/layout/tools-properties.reel/tools-properties.html
js/document/document-html.js
js/document/templates/app/main.js
js/panels/Panel.reel/Panel.js
node_modules/montage/ui/native-control.js
Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'js/document/views')
-rwxr-xr-x | js/document/views/design.js | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/js/document/views/design.js b/js/document/views/design.js index 4484167a..6a6f565d 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js | |||
@@ -280,7 +280,9 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
280 | //Removing loading container (should be removed) | 280 | //Removing loading container (should be removed) |
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 stags = this.document.getElementsByTagName('style'), | 283 | var htags = this.document.getElementsByTagName('html'), |
284 | userStyles, | ||
285 | stags = this.document.getElementsByTagName('style'), | ||
284 | ltags = this.document.getElementsByTagName('link'), i, orgNodes, | 286 | ltags = this.document.getElementsByTagName('link'), i, orgNodes, |
285 | scripttags = this.document.getElementsByTagName('script'); | 287 | scripttags = this.document.getElementsByTagName('script'); |
286 | //Temporarily checking for disabled special case (we must enabled for Ninja to access styles) | 288 | //Temporarily checking for disabled special case (we must enabled for Ninja to access styles) |
@@ -319,7 +321,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
319 | //Else there is not data to parse | 321 | //Else there is not data to parse |
320 | if(this._viewCallback) { | 322 | if(this._viewCallback) { |
321 | this._viewCallback.viewCallback.call(this._viewCallback.context); | 323 | this._viewCallback.viewCallback.call(this._viewCallback.context); |
322 | } | 324 | } |
323 | } | 325 | } |
324 | //TODO: Verify appropiate location for this operation | 326 | //TODO: Verify appropiate location for this operation |
325 | if (this._template && this._template.type === 'banner') { | 327 | if (this._template && this._template.type === 'banner') { |
@@ -335,8 +337,19 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
335 | for (var n in orgNodes) { | 337 | for (var n in orgNodes) { |
336 | if (orgNodes[n].getAttribute) orgNodes[n].setAttribute('data-ninja-node', 'true'); | 338 | if (orgNodes[n].getAttribute) orgNodes[n].setAttribute('data-ninja-node', 'true'); |
337 | } | 339 | } |
338 | 340 | ||
339 | //Makign callback if specified | 341 | // Save initial HTML and Body/ninja-content style attributes so we don't override them on save |
342 | if(htags.length) { | ||
343 | if(userStyles = htags[0].getAttribute('style')) { | ||
344 | htags[0].setAttribute('data-ninja-style', userStyles); | ||
345 | } | ||
346 | } | ||
347 | if(this.documentRoot) { | ||
348 | if(userStyles = this.documentRoot.getAttribute('style')) { | ||
349 | this.documentRoot.setAttribute('data-ninja-style', userStyles); | ||
350 | } | ||
351 | } | ||
352 | //Making callback if specified | ||
340 | if (this._callback) this._callback(); | 353 | if (this._callback) this._callback(); |
341 | } | 354 | } |
342 | }, | 355 | }, |