aboutsummaryrefslogtreecommitdiff
path: root/js/document/document-html.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-05 21:40:44 -0700
committerValerio Virgillito2012-06-05 21:40:44 -0700
commite28eb9158a50d7e6d97dbc68066e591ac600c241 (patch)
tree1615affe62374ae67eaecb8b1966a2f464559dfa /js/document/document-html.js
parentd7555c35b357e28a1e1ccc1c4edc4fe04d2b139a (diff)
downloadninja-e28eb9158a50d7e6d97dbc68066e591ac600c241.tar.gz
removing all model creators.
The elementModel is now a getter that will create a new model when needed. Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/document/document-html.js')
-rwxr-xr-xjs/document/document-html.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/js/document/document-html.js b/js/document/document-html.js
index 33a41a8e..4a8d5d41 100755
--- a/js/document/document-html.js
+++ b/js/document/document-html.js
@@ -88,7 +88,7 @@ exports.HtmlDocument = Montage.create(Component, {
88 //Adding observer to know when template is ready 88 //Adding observer to know when template is ready
89 this._observer = new WebKitMutationObserver(this.handleTemplateReady.bind(this)); 89 this._observer = new WebKitMutationObserver(this.handleTemplateReady.bind(this));
90 this._observer.observe(this.model.views.design.document.head, {childList: true}); 90 this._observer.observe(this.model.views.design.document.head, {childList: true});
91 }.bind(this), template); 91 }.bind(this), template, {viewCallback: this.handleViewReady, context: this});
92 } else { 92 } else {
93 //TODO: Identify default view (probably code) 93 //TODO: Identify default view (probably code)
94 } 94 }
@@ -101,10 +101,14 @@ exports.HtmlDocument = Montage.create(Component, {
101 //Removing observer, only needed on initial load 101 //Removing observer, only needed on initial load
102 this._observer.disconnect(); 102 this._observer.disconnect();
103 this._observer = null; 103 this._observer = null;
104 //Making callback after view is loaded
105 this.loaded.callback.call(this.loaded.context, this);
106 } 104 }
107 }, 105 },
106 handleViewReady: {
107 value: function() {
108 //Making callback after view is loaded
109 this.loaded.callback.call(this.loaded.context, this);
110 }
111 },
108 //////////////////////////////////////////////////////////////////// 112 ////////////////////////////////////////////////////////////////////
109 // 113 //
110 closeDocument: { 114 closeDocument: {