aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/html-document.js4
-rw-r--r--js/document/templates/montage-html/main.reel/main.js14
2 files changed, 14 insertions, 4 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js
index d4db6e2f..be1f89e2 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -905,7 +905,7 @@ exports.HTMLDocument = Montage.create(TextDocument, {
905 } 905 }
906 } 906 }
907 } 907 }
908 return {mode: 'html', document: this._userDocument, webgl: this.glData, styles: styles, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML}; 908 return {mode: 'html', document: this._userDocument, mjs: this._userComponents, webgl: this.glData, styles: styles, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML};
909 } else if (this.currentView === "code"){ 909 } else if (this.currentView === "code"){
910 //TODO: Would this get call when we are in code of HTML? 910 //TODO: Would this get call when we are in code of HTML?
911 } else { 911 } else {
@@ -928,7 +928,7 @@ exports.HTMLDocument = Montage.create(TextDocument, {
928 } 928 }
929 } 929 }
930 } 930 }
931 return {mode: 'html', document: this._userDocument, webgl: this.glData, css: css, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML}; 931 return {mode: 'html', document: this._userDocument, mjs: this._userComponents, webgl: this.glData, css: css, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML};
932 } else if (this.currentView === "code"){ 932 } else if (this.currentView === "code"){
933 //TODO: Would this get call when we are in code of HTML? 933 //TODO: Would this get call when we are in code of HTML?
934 } else { 934 } else {
diff --git a/js/document/templates/montage-html/main.reel/main.js b/js/document/templates/montage-html/main.reel/main.js
index 6c141108..2970f37a 100644
--- a/js/document/templates/montage-html/main.reel/main.js
+++ b/js/document/templates/montage-html/main.reel/main.js
@@ -27,16 +27,17 @@ exports.Main = Montage.create(Component, {
27 var componentInstance = componentRequire.create(); 27 var componentInstance = componentRequire.create();
28 28
29 componentInstance.element = element; 29 componentInstance.element = element;
30 //componentInstance.deserializedFromTemplate(); 30
31 componentInstance.needsDraw = true; 31 componentInstance.needsDraw = true;
32 componentInstance.ownerComponent = self; 32 componentInstance.ownerComponent = self;
33 33
34 componentInstance.addEventListener("firstDraw", self, false);
35
34 callback(componentInstance, element); 36 callback(componentInstance, element);
35 }) 37 })
36 .end(); 38 .end();
37 39
38 }; 40 };
39// window.addBinding = this.addBindingToUserDocument;
40 41
41 // Dispatch event when this template has loaded. 42 // Dispatch event when this template has loaded.
42 var newEvent = document.createEvent( "CustomEvent" ); 43 var newEvent = document.createEvent( "CustomEvent" );
@@ -45,5 +46,14 @@ exports.Main = Montage.create(Component, {
45 document.body.dispatchEvent( newEvent ); 46 document.body.dispatchEvent( newEvent );
46 47
47 } 48 }
49 },
50
51 handleFirstDraw: {
52 value: function() {
53 var newEvent = document.createEvent( "CustomEvent" );
54 newEvent.initCustomEvent( "addComponentFirstDraw", false, true );
55
56 document.body.dispatchEvent( newEvent );
57 }
48 } 58 }
49}); \ No newline at end of file 59}); \ No newline at end of file