aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
authorJose Antonio Marquez Russo2012-02-23 08:05:06 -0800
committerJose Antonio Marquez Russo2012-02-23 08:05:06 -0800
commitc8a5107fa6f85ad572cf0881ed7e222ac6fbacfc (patch)
tree61bac34de22852efd2b9b8880f62210685b16297 /js/document
parentd264092596ba697cd04738566184270dc608be63 (diff)
parent64a971f63333d74ca89690892a52948b3bd4283a (diff)
downloadninja-c8a5107fa6f85ad572cf0881ed7e222ac6fbacfc.tar.gz
Merge pull request #18 from mencio/file-io
File io - drawing the layout on open and make models
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/html-document.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 143b1598..eaf56146 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -23,6 +23,7 @@ exports.HTMLDocument = Montage.create(TextDocument, {
23 23
24 _document: { value: null, enumerable: false }, 24 _document: { value: null, enumerable: false },
25 _documentRoot: { value: null, enumerable: false }, 25 _documentRoot: { value: null, enumerable: false },
26 _liveNodeList: { value: null, enumarable: false },
26 _stageBG: { value: null, enumerable: false }, 27 _stageBG: { value: null, enumerable: false },
27 _window: { value: null, enumerable: false }, 28 _window: { value: null, enumerable: false },
28 _styles: { value: null, enumerable: false }, 29 _styles: { value: null, enumerable: false },
@@ -402,7 +403,16 @@ exports.HTMLDocument = Montage.create(TextDocument, {
402 //Adding a handler for the main user document reel to finish loading 403 //Adding a handler for the main user document reel to finish loading
403 this._document.body.addEventListener("userTemplateDidLoad", this.userTemplateDidLoad.bind(this), false); 404 this._document.body.addEventListener("userTemplateDidLoad", this.userTemplateDidLoad.bind(this), false);
404 405
405 406 // Live node list of the current loaded document
407 this._liveNodeList = this.documentRoot.getElementsByTagName('*');
408
409 // TODO Move this to the appropriate location
410 var len = this._liveNodeList.length;
411
412 for(var i = 0; i < len; i++) {
413 NJUtils.makeModelFromElement(this._liveNodeList[i]);
414 }
415
406 /* this.iframe.contentWindow.document.addEventListener('DOMSubtreeModified', function (e) { */ //TODO: Remove events upon loading once 416 /* this.iframe.contentWindow.document.addEventListener('DOMSubtreeModified', function (e) { */ //TODO: Remove events upon loading once
407 417
408 //TODO: When re-written, the best way to initialize the document is to listen for the DOM tree being modified 418 //TODO: When re-written, the best way to initialize the document is to listen for the DOM tree being modified