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