diff options
author | Nivesh Rajbhandari | 2012-05-24 13:54:00 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-05-24 13:54:00 -0700 |
commit | fd4af6d81725dfa0630ac5e52ba95405336f4074 (patch) | |
tree | 868197f79862e98b9c7f5a1f296d64832c68d48f /js/document/document-html.js | |
parent | de25d2b7d05476d4f0d385b5e910db189f682d21 (diff) | |
parent | 70ff8dd670bc37c14caf850e06791d1e293b1e4b (diff) | |
download | ninja-fd4af6d81725dfa0630ac5e52ba95405336f4074.tar.gz |
Merge branch 'refs/heads/dom-architecture-master' into Dom-Architecture
Diffstat (limited to 'js/document/document-html.js')
-rwxr-xr-x | js/document/document-html.js | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/js/document/document-html.js b/js/document/document-html.js index 2fc32791..c60a12a2 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js | |||
@@ -6,10 +6,10 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
6 | 6 | ||
7 | //////////////////////////////////////////////////////////////////////// | 7 | //////////////////////////////////////////////////////////////////////// |
8 | // | 8 | // |
9 | var Montage = require("montage/core/core").Montage, | 9 | var Montage = require("montage/core/core").Montage, |
10 | Component = require("montage/ui/component").Component, | 10 | Component = require("montage/ui/component").Component, |
11 | HtmlDocumentModel = require("js/document/models/html").HtmlDocumentModel, | 11 | HtmlDocumentModel = require("js/document/models/html").HtmlDocumentModel, |
12 | DesignDocumentView = require("js/document/views/design").DesignDocumentView; | 12 | DesignDocumentView = require("js/document/views/design").DesignDocumentView; |
13 | //////////////////////////////////////////////////////////////////////// | 13 | //////////////////////////////////////////////////////////////////////// |
14 | // | 14 | // |
15 | exports.HtmlDocument = Montage.create(Component, { | 15 | exports.HtmlDocument = Montage.create(Component, { |
@@ -33,15 +33,10 @@ exports.HtmlDocument = Montage.create(Component, { | |||
33 | _observer: { | 33 | _observer: { |
34 | value: null | 34 | value: null |
35 | }, | 35 | }, |
36 | //////////////////////////////////////////////////////////////////// | ||
37 | // | ||
38 | _document: { | ||
39 | value: null //TODO: Figure out if this will be needed, probably not | ||
40 | }, | ||
41 | //////////////////////////////////////////////////////////////////// | 36 | //////////////////////////////////////////////////////////////////// |
42 | // | 37 | // |
43 | exclusionList: { | 38 | exclusionList: { |
44 | value: ["HTML", "BODY", "NINJA-CONTENT"] //TODO: Update to correct list | 39 | value: ["HTML", "BODY", "NINJA-CONTENT"] |
45 | }, | 40 | }, |
46 | //////////////////////////////////////////////////////////////////// | 41 | //////////////////////////////////////////////////////////////////// |
47 | // | 42 | // |
@@ -72,7 +67,7 @@ exports.HtmlDocument = Montage.create(Component, { | |||
72 | //Hiding iFrame, just initiliazing | 67 | //Hiding iFrame, just initiliazing |
73 | this.model.views.design.hide(); | 68 | this.model.views.design.hide(); |
74 | } else { | 69 | } else { |
75 | //ERROR: Design View not initilized | 70 | //ERROR: Design View not initialized |
76 | } | 71 | } |
77 | // | 72 | // |
78 | if (view === 'design') { | 73 | if (view === 'design') { |
@@ -84,23 +79,10 @@ exports.HtmlDocument = Montage.create(Component, { | |||
84 | this.model.views.design.show(); | 79 | this.model.views.design.show(); |
85 | this.model.views.design.iframe.style.opacity = 0; | 80 | this.model.views.design.iframe.style.opacity = 0; |
86 | this.model.views.design.content = this.model.file.content; | 81 | this.model.views.design.content = this.model.file.content; |
87 | //TODO: Improve reference | 82 | //TODO: Improve reference (probably through binding values) |
88 | this.model.views.design.model = this.model; | 83 | this.model.views.design.model = this.model; |
89 | // | 84 | //Rendering design view, using observers to know when template is ready |
90 | //TODO: Clean up | ||
91 | this.model.views.design.render(function () { | 85 | this.model.views.design.render(function () { |
92 | //TODO: Identify and remove usage of '_document' | ||
93 | this._document = this.model.views.design.document; | ||
94 | //TODO: Remove usage, seems as not needed | ||
95 | if (template && template.type === 'banner') { | ||
96 | this.documentRoot = this.model.views.design.document.body.getElementsByTagName('ninja-content')[0]; | ||
97 | } else { | ||
98 | this.documentRoot = this.model.views.design.document.body; | ||
99 | } | ||
100 | //TODO: Why is this needed? | ||
101 | this.model.views.design._liveNodeList = this.documentRoot.getElementsByTagName('*'); | ||
102 | //Initiliazing document model | ||
103 | document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body"); | ||
104 | //Adding observer to know when template is ready | 86 | //Adding observer to know when template is ready |
105 | this._observer = new WebKitMutationObserver(this.handleTemplateReady.bind(this)); | 87 | this._observer = new WebKitMutationObserver(this.handleTemplateReady.bind(this)); |
106 | this._observer.observe(this.model.views.design.document.head, {childList: true}); | 88 | this._observer.observe(this.model.views.design.document.head, {childList: true}); |