diff options
Diffstat (limited to 'js/document')
-rwxr-xr-x | js/document/models/html.js | 5 | ||||
-rw-r--r-- | js/document/templates/app/main.js | 1 | ||||
-rwxr-xr-x | js/document/views/design.js | 6 |
3 files changed, 11 insertions, 1 deletions
diff --git a/js/document/models/html.js b/js/document/models/html.js index fd42d4de..a93faa9e 100755 --- a/js/document/models/html.js +++ b/js/document/models/html.js | |||
@@ -74,6 +74,7 @@ exports.HtmlDocumentModel = Montage.create(BaseDocumentModel, { | |||
74 | setComponentInstance: { | 74 | setComponentInstance: { |
75 | value: function(instance, el) { | 75 | value: function(instance, el) { |
76 | this.userComponents[el.uuid] = instance; | 76 | this.userComponents[el.uuid] = instance; |
77 | this.objects.push(instance); | ||
77 | } | 78 | } |
78 | }, | 79 | }, |
79 | //////////////////////////////////////////////////////////////////// | 80 | //////////////////////////////////////////////////////////////////// |
@@ -86,6 +87,10 @@ exports.HtmlDocumentModel = Montage.create(BaseDocumentModel, { | |||
86 | return null; | 87 | return null; |
87 | } | 88 | } |
88 | } | 89 | } |
90 | }, | ||
91 | //////////////////////////////////////////////////////////////////// | ||
92 | objects : { | ||
93 | value: null | ||
89 | } | 94 | } |
90 | //////////////////////////////////////////////////////////////////// | 95 | //////////////////////////////////////////////////////////////////// |
91 | //////////////////////////////////////////////////////////////////// | 96 | //////////////////////////////////////////////////////////////////// |
diff --git a/js/document/templates/app/main.js b/js/document/templates/app/main.js index a406abdb..91c46fda 100644 --- a/js/document/templates/app/main.js +++ b/js/document/templates/app/main.js | |||
@@ -29,6 +29,7 @@ exports.Main = Montage.create(Component, { | |||
29 | var componentRequire = component[data.name]; | 29 | var componentRequire = component[data.name]; |
30 | var componentInstance = componentRequire.create(); | 30 | var componentInstance = componentRequire.create(); |
31 | 31 | ||
32 | componentInstance._montage_metadata.label = data.name; | ||
32 | componentInstance.element = element; | 33 | componentInstance.element = element; |
33 | 34 | ||
34 | componentInstance.needsDraw = true; | 35 | componentInstance.needsDraw = true; |
diff --git a/js/document/views/design.js b/js/document/views/design.js index c7313708..947ad196 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js | |||
@@ -395,11 +395,15 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
395 | initMontage: { | 395 | initMontage: { |
396 | value: function (scripttags) { | 396 | value: function (scripttags) { |
397 | // | 397 | // |
398 | //debugger; | ||
398 | this.iframe.contentWindow.document.body.addEventListener('mjsTemplateReady', function () { | 399 | this.iframe.contentWindow.document.body.addEventListener('mjsTemplateReady', function () { |
399 | //Initializing template with user's seriliazation | 400 | //Initializing template with user's seriliazation |
400 | var template = this.iframe.contentWindow.mjsTemplate.create(); | 401 | var template = this.iframe.contentWindow.mjsTemplate.create(); |
402 | |||
401 | template.initWithDocument(this.iframe.contentWindow.document); | 403 | template.initWithDocument(this.iframe.contentWindow.document); |
402 | template.instantiateWithOwnerAndDocument(null, this.iframe.contentWindow.document, function (e){/*Nothing just a required extra parameter*/}); | 404 | template.instantiateWithOwnerAndDocument(null, this.iframe.contentWindow.document, function (e){ |
405 | this.model.objects = template.deserializer.getObjectsFromLastDeserialization(); | ||
406 | }.bind(this)); | ||
403 | }.bind(this), false); | 407 | }.bind(this), false); |
404 | } | 408 | } |
405 | }, | 409 | }, |