aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
Diffstat (limited to 'js/document')
-rw-r--r--js/document/templates/app/main.js1
-rwxr-xr-xjs/document/templates/html/index.html5
-rwxr-xr-xjs/document/views/design.js3
3 files changed, 8 insertions, 1 deletions
diff --git a/js/document/templates/app/main.js b/js/document/templates/app/main.js
index 0cdf718c..bb4cd829 100644
--- a/js/document/templates/app/main.js
+++ b/js/document/templates/app/main.js
@@ -61,6 +61,7 @@ exports.Main = Montage.create(Component, {
61 var componentRequire = component[data.name]; 61 var componentRequire = component[data.name];
62 var componentInstance = componentRequire.create(); 62 var componentInstance = componentRequire.create();
63 63
64 componentInstance._montage_metadata.label = componentInstance.identifier = data.name;
64 componentInstance.element = element; 65 componentInstance.element = element;
65 66
66 componentInstance.needsDraw = true; 67 componentInstance.needsDraw = true;
diff --git a/js/document/templates/html/index.html b/js/document/templates/html/index.html
index 8fc0d82f..bee2e557 100755
--- a/js/document/templates/html/index.html
+++ b/js/document/templates/html/index.html
@@ -113,7 +113,10 @@
113 <script type="text/montage-serialization" data-ninja-template="true"> 113 <script type="text/montage-serialization" data-ninja-template="true">
114 { 114 {
115 "owner": { 115 "owner": {
116 "prototype": "main" 116 "prototype": "main",
117 "properties": {
118 "identifier": "testOwner"
119 }
117 } 120 }
118 } 121 }
119 </script> 122 </script>
diff --git a/js/document/views/design.js b/js/document/views/design.js
index 1a5b071e..dad6de8b 100755
--- a/js/document/views/design.js
+++ b/js/document/views/design.js
@@ -442,15 +442,18 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
442 value: function (scripttags) { 442 value: function (scripttags) {
443 var self = this; 443 var self = this;
444 // 444 //
445 //debugger;
445 this.iframe.contentWindow.document.body.addEventListener('mjsTemplateReady', function () { 446 this.iframe.contentWindow.document.body.addEventListener('mjsTemplateReady', function () {
446 //Initializing template with user's seriliazation 447 //Initializing template with user's seriliazation
447 var template = this.iframe.contentWindow.mjsTemplate.create(); 448 var template = this.iframe.contentWindow.mjsTemplate.create();
449
448 template.initWithDocument(this.iframe.contentWindow.document); 450 template.initWithDocument(this.iframe.contentWindow.document);
449 template.instantiateWithOwnerAndDocument(null, this.iframe.contentWindow.document, function (){ 451 template.instantiateWithOwnerAndDocument(null, this.iframe.contentWindow.document, function (){
450 //TODO: Verify this is properly done, seems like a hack 452 //TODO: Verify this is properly done, seems like a hack
451 for (var c in template._deserializer._objects) { 453 for (var c in template._deserializer._objects) {
452 //Forcing draw on components 454 //Forcing draw on components
453 template._deserializer._objects[c].needsDraw = true; 455 template._deserializer._objects[c].needsDraw = true;
456 //this.model.objects = template.deserializer.getObjectsFromLastDeserialization();
454 } 457 }
455 458
456 // Now call the view callback 459 // Now call the view callback