diff options
Diffstat (limited to 'js/document/document-html.js')
-rwxr-xr-x | js/document/document-html.js | 10 |
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: { |