From 94190d38d659b05a0f071e88134651c2484629f6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 1 Jun 2012 13:47:22 -0700 Subject: Fixing webGL helper --- js/document/document-html.js | 2 ++ js/document/models/html.js | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'js/document') diff --git a/js/document/document-html.js b/js/document/document-html.js index c60a12a2..b5684dc5 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -62,6 +62,8 @@ exports.HtmlDocument = Montage.create(Component, { parentContainer: {value: document.getElementById("iframeContainer")}, //Saving reference to parent container of all views (should be changed to buckets approach views: {value: {'design': DesignDocumentView.create(), 'code': null}} //TODO: Add code view logic }); + //Calling the any init routines in the model + this.model.init(); //Initiliazing views and hiding if (this.model.views.design.initialize(this.model.parentContainer)) { //Hiding iFrame, just initiliazing diff --git a/js/document/models/html.js b/js/document/models/html.js index fd42d4de..0fe33990 100755 --- a/js/document/models/html.js +++ b/js/document/models/html.js @@ -17,6 +17,14 @@ exports.HtmlDocumentModel = Montage.create(BaseDocumentModel, { hasTemplate: { value: false }, + //////////////////////////////////////////////////////////////////// + //Called by the document immidiately after the model is created + init: { + value:function() { + //Creating instance of the webGL helper for this model + this.webGlHelper = webGlDocumentHelper.create(); + } + }, //////////////////////////////////////////////////////////////////// // selection: { @@ -57,7 +65,7 @@ exports.HtmlDocumentModel = Montage.create(BaseDocumentModel, { //////////////////////////////////////////////////////////////////// // webGlHelper: { - value: webGlDocumentHelper + value: null }, //////////////////////////////////////////////////////////////////// // -- cgit v1.2.3