aboutsummaryrefslogtreecommitdiff
path: root/js/document/views/design.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/document/views/design.js')
-rwxr-xr-xjs/document/views/design.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/js/document/views/design.js b/js/document/views/design.js
index d5c5c6c4..6a60e1f9 100755
--- a/js/document/views/design.js
+++ b/js/document/views/design.js
@@ -461,21 +461,25 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
461 initMontage: { 461 initMontage: {
462 value: function (scripttags) { 462 value: function (scripttags) {
463 var self = this; 463 var self = this;
464 // 464
465 this.iframe.contentWindow.document.body.addEventListener('mjsTemplateReady', function () { 465 this.iframe.contentWindow.document.body.addEventListener('mjsTemplateReady', function () {
466 //Initializing template with user's seriliazation 466 //Initializing template with user's seriliazation
467 var template = this.iframe.contentWindow.mjsTemplate.create(); 467 var template = this.iframe.contentWindow.mjsTemplate.create();
468
468 template.initWithDocument(this.iframe.contentWindow.document); 469 template.initWithDocument(this.iframe.contentWindow.document);
469 template.instantiateWithOwnerAndDocument(null, this.iframe.contentWindow.document, function (){ 470 template.instantiateWithOwnerAndDocument(null, this.iframe.contentWindow.document, function (){
470 //TODO: Verify this is properly done, seems like a hack 471 //TODO: Verify this is properly done, seems like a hack
472
473 var objArray = [];
471 for (var c in template._deserializer._objects) { 474 for (var c in template._deserializer._objects) {
472 //Forcing draw on components 475 //Forcing draw on components
473 template._deserializer._objects[c].needsDraw = true; 476 template._deserializer._objects[c].needsDraw = true;
477 objArray.push(template._deserializer._objects[c]);
474 } 478 }
475 479
476 // Now call the view callback 480 // Now call the view callback
477 if(self._viewCallback) { 481 if(self._viewCallback) {
478 self._viewCallback.viewCallback.call(self._viewCallback.context); 482 self._viewCallback.viewCallback.call(self._viewCallback.context, objArray);
479 } 483 }
480 484
481 }); 485 });