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