From 1f7c17d688c3340b31d2e1c2b7205b10bd806968 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Fri, 25 May 2012 16:37:24 -0700 Subject: Objects Controller - Now keeps track of document's object instances, including added components --- js/document/views/design.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'js/document/views') diff --git a/js/document/views/design.js b/js/document/views/design.js index b3887fdf..75eb3695 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js @@ -363,11 +363,15 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { initMontage: { value: function (scripttags) { // + //debugger; this.iframe.contentWindow.document.body.addEventListener('mjsTemplateReady', function () { //Initializing template with user's seriliazation var template = this.iframe.contentWindow.mjsTemplate.create(); + template.initWithDocument(this.iframe.contentWindow.document); - template.instantiateWithOwnerAndDocument(null, this.iframe.contentWindow.document, function (e){/*Nothing just a required extra parameter*/}); + template.instantiateWithOwnerAndDocument(null, this.iframe.contentWindow.document, function (e){ + this.model.objects = template.deserializer.getObjectsFromLastDeserialization(); + }.bind(this)); }.bind(this), false); } }, -- cgit v1.2.3