aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-23 01:49:33 -0800
committerValerio Virgillito2012-02-23 01:49:33 -0800
commit31d73bccdda6145c6bbb5c25f6db3e139fcb9e6c (patch)
treebf390bfdd02d37f314c3aaca00b4a59106dcc355 /js/document
parentf8e491fe81981c95fb1352a21d1f99cc375f240e (diff)
downloadninja-31d73bccdda6145c6bbb5c25f6db3e139fcb9e6c.tar.gz
Enabling outline on open documents and parsing doom on open to create models.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
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 9a7755e6..b13dcc1e 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 },
@@ -396,7 +397,16 @@ exports.HTMLDocument = Montage.create(TextDocument, {
396 // Adding a handler for the main user document reel to finish loading. 397 // Adding a handler for the main user document reel to finish loading.
397 this._document.body.addEventListener("userTemplateDidLoad", this.userTemplateDidLoad.bind(this), false); 398 this._document.body.addEventListener("userTemplateDidLoad", this.userTemplateDidLoad.bind(this), false);
398 399
399 400 // Live node list of the current loaded document
401 this._liveNodeList = this.documentRoot.getElementsByTagName('*');
402
403 // TODO Move this to the appropriate location
404 var len = this._liveNodeList.length;
405
406 for(var i = 0; i < len; i++) {
407 NJUtils.makeElementModel2(this._liveNodeList[i]);
408 }
409
400 /* this.iframe.contentWindow.document.addEventListener('DOMSubtreeModified', function (e) { */ //TODO: Remove events upon loading once 410 /* this.iframe.contentWindow.document.addEventListener('DOMSubtreeModified', function (e) { */ //TODO: Remove events upon loading once
401 411
402 //TODO: When written, the best way to initialize the document is to listen for the DOM tree being modified 412 //TODO: When written, the best way to initialize the document is to listen for the DOM tree being modified