From 337efc667372326ae2f9984d89a47bb151016774 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Mon, 11 Jun 2012 13:25:13 -0700 Subject: Changes Made to Object Listing of iFrame Signed-off-by: Armen Kesablyan --- js/document/document-html.js | 3 ++- js/document/models/base.js | 13 +++++++++++++ js/document/models/html.js | 3 ++- js/document/views/design.js | 6 ++++-- 4 files changed, 21 insertions(+), 4 deletions(-) (limited to 'js/document') diff --git a/js/document/document-html.js b/js/document/document-html.js index 04565753..8b82c40f 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -106,7 +106,8 @@ exports.HtmlDocument = Montage.create(Component, { } }, handleViewReady: { - value: function() { + value: function(mObjects) { + this.model.mObjects = mObjects; //Making callback after view is loaded this.loaded.callback.call(this.loaded.context, this); } diff --git a/js/document/models/base.js b/js/document/models/base.js index 5fa06259..9c26bd2a 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js @@ -91,6 +91,19 @@ exports.BaseDocumentModel = Montage.create(Component, { libs: { value: null }, + + _mObjects: { + value: [] + }, + + mObjects: { + get: function() { + return this._mObjects; + }, + set: function(value) { + this._mObjects = value; + } + }, //////////////////////////////////////////////////////////////////// // switchViewTo: { diff --git a/js/document/models/html.js b/js/document/models/html.js index 7064c6e3..f65cd8c3 100755 --- a/js/document/models/html.js +++ b/js/document/models/html.js @@ -73,9 +73,10 @@ exports.HtmlDocumentModel = Montage.create(BaseDocumentModel, { // webGlHelper: { value: null - }, + } //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// + }); //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/js/document/views/design.js b/js/document/views/design.js index dad6de8b..4484167a 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js @@ -450,15 +450,17 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { template.initWithDocument(this.iframe.contentWindow.document); template.instantiateWithOwnerAndDocument(null, this.iframe.contentWindow.document, function (){ //TODO: Verify this is properly done, seems like a hack + + var objArray = []; for (var c in template._deserializer._objects) { //Forcing draw on components template._deserializer._objects[c].needsDraw = true; - //this.model.objects = template.deserializer.getObjectsFromLastDeserialization(); + objArray.push(template._deserializer._objects[c]); } // Now call the view callback if(self._viewCallback) { - self._viewCallback.viewCallback.call(self._viewCallback.context); + self._viewCallback.viewCallback.call(self._viewCallback.context, objArray); } }); -- cgit v1.2.3