From e28eb9158a50d7e6d97dbc68066e591ac600c241 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 5 Jun 2012 21:40:44 -0700 Subject: removing all model creators. The elementModel is now a getter that will create a new model when needed. Signed-off-by: Valerio Virgillito --- js/document/document-html.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'js/document/document-html.js') 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, { //Adding observer to know when template is ready this._observer = new WebKitMutationObserver(this.handleTemplateReady.bind(this)); this._observer.observe(this.model.views.design.document.head, {childList: true}); - }.bind(this), template); + }.bind(this), template, {viewCallback: this.handleViewReady, context: this}); } else { //TODO: Identify default view (probably code) } @@ -101,10 +101,14 @@ exports.HtmlDocument = Montage.create(Component, { //Removing observer, only needed on initial load this._observer.disconnect(); this._observer = null; - //Making callback after view is loaded - this.loaded.callback.call(this.loaded.context, this); } }, + handleViewReady: { + value: function() { + //Making callback after view is loaded + this.loaded.callback.call(this.loaded.context, this); + } + }, //////////////////////////////////////////////////////////////////// // closeDocument: { -- cgit v1.2.3 From 6a0f150f49be656e0725bc77b452a3141dddd47c Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 6 Jun 2012 13:46:02 -0700 Subject: Cleaning up Removed reference of model in design view, clean up slightly, need to implement binding later. --- js/document/document-html.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js/document/document-html.js') diff --git a/js/document/document-html.js b/js/document/document-html.js index 33a41a8e..c9acd2e0 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -68,6 +68,8 @@ exports.HtmlDocument = Montage.create(Component, { if (this.model.views.design.initialize(this.model.parentContainer)) { //Hiding iFrame, just initiliazing this.model.views.design.hide(); + //Setting the iFrame property for reference in helper class + this.model.webGlHelper.iframe = this.model.views.design.iframe; } else { //ERROR: Design View not initialized } @@ -82,7 +84,7 @@ exports.HtmlDocument = Montage.create(Component, { this.model.views.design.iframe.style.opacity = 0; this.model.views.design.content = this.model.file.content; //TODO: Improve reference (probably through binding values) - this.model.views.design.model = this.model; + this.model.views.design._webGlHelper = this.model.webGlHelper; //Rendering design view, using observers to know when template is ready this.model.views.design.render(function () { //Adding observer to know when template is ready -- cgit v1.2.3