diff options
author | Valerio Virgillito | 2012-05-24 11:28:27 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-24 11:28:27 -0700 |
commit | a8eb5c65a21af3bf8d8b8eb3e65b494b8bd9bc01 (patch) | |
tree | f6f2e044c646ea2749fafc29f1a1c3fabd2825ea /js/document | |
parent | 0ca1910df1c78116139664bf39a95cf0ec7c8dc8 (diff) | |
parent | f801708f83aadfc688e69a244eb7cbaeca5d5e8d (diff) | |
download | ninja-a8eb5c65a21af3bf8d8b8eb3e65b494b8bd9bc01.tar.gz |
Merge pull request #254 from mqg734/Dom-Architecture
Updates to stage code for handling multiple document workflow.
Diffstat (limited to 'js/document')
-rwxr-xr-x | js/document/document-html.js | 2 | ||||
-rwxr-xr-x | js/document/views/design.js | 29 |
2 files changed, 27 insertions, 4 deletions
diff --git a/js/document/document-html.js b/js/document/document-html.js index f92a425c..2fc32791 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js | |||
@@ -98,7 +98,7 @@ exports.HtmlDocument = Montage.create(Component, { | |||
98 | this.documentRoot = this.model.views.design.document.body; | 98 | this.documentRoot = this.model.views.design.document.body; |
99 | } | 99 | } |
100 | //TODO: Why is this needed? | 100 | //TODO: Why is this needed? |
101 | this._liveNodeList = this.documentRoot.getElementsByTagName('*'); | 101 | this.model.views.design._liveNodeList = this.documentRoot.getElementsByTagName('*'); |
102 | //Initiliazing document model | 102 | //Initiliazing document model |
103 | document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body"); | 103 | document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body"); |
104 | //Adding observer to know when template is ready | 104 | //Adding observer to know when template is ready |
diff --git a/js/document/views/design.js b/js/document/views/design.js index b3887fdf..13f89692 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js | |||
@@ -67,8 +67,34 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
67 | propertiesPanel: { | 67 | propertiesPanel: { |
68 | value: null | 68 | value: null |
69 | }, | 69 | }, |
70 | |||
70 | //////////////////////////////////////////////////////////////////// | 71 | //////////////////////////////////////////////////////////////////// |
71 | // | 72 | // |
73 | _liveNodeList: { | ||
74 | value: null | ||
75 | }, | ||
76 | |||
77 | getLiveNodeList: { | ||
78 | value: function(useFilter) { | ||
79 | if(useFilter) { | ||
80 | var filteredNodes = [], | ||
81 | childNodes = Array.prototype.slice.call(this._liveNodeList, 0); | ||
82 | |||
83 | childNodes.forEach(function(item) { | ||
84 | if( (item.nodeType === 1) && (item.nodeName !== "STYLE") && (item.nodeName !== "SCRIPT")) { | ||
85 | filteredNodes.push(item); | ||
86 | } | ||
87 | }); | ||
88 | return filteredNodes; | ||
89 | } else { | ||
90 | return Array.prototype.slice.call(this._liveNodeList, 0); | ||
91 | } | ||
92 | } | ||
93 | }, | ||
94 | //////////////////////////////////////////////////////////////////// | ||
95 | // | ||
96 | |||
97 | // | ||
72 | initialize: { | 98 | initialize: { |
73 | value: function (parent) { | 99 | value: function (parent) { |
74 | //Creating iFrame for view | 100 | //Creating iFrame for view |
@@ -189,9 +215,6 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
189 | this._bodyFragment = null; | 215 | this._bodyFragment = null; |
190 | //Calling standard method to finish opening document | 216 | //Calling standard method to finish opening document |
191 | this.bodyContentLoaded(null); | 217 | this.bodyContentLoaded(null); |
192 | //TODO: Move this to be set via the controller | ||
193 | this.application.ninja.stage.documentOffsetLeft = parseInt((this.document.body.scrollWidth - this._template.size.width)/2); | ||
194 | this.application.ninja.stage.documentOffsetTop = parseInt((this.document.body.scrollHeight - this._template.size.height)/2); | ||
195 | } | 218 | } |
196 | }, | 219 | }, |
197 | //////////////////////////////////////////////////////////////////// | 220 | //////////////////////////////////////////////////////////////////// |