aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-06-27 09:59:01 -0700
committerJose Antonio Marquez2012-06-27 09:59:01 -0700
commitca1e79d4dc36a55c47b6f8cb92069eafc95383b5 (patch)
tree2bf23250a605ca42a33f7bc75698357e0258d624 /js/document
parent245e70117f9605dc5603328c97685b2e5a10f220 (diff)
parent2ebf3e3ea24d0d580575dfa13d31588dac1de445 (diff)
downloadninja-ca1e79d4dc36a55c47b6f8cb92069eafc95383b5.tar.gz
Merge branch 'refs/heads/Ninja-Internal' into Document
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/document-html.js3
-rwxr-xr-xjs/document/models/base.js13
-rwxr-xr-xjs/document/models/html.js3
-rw-r--r--js/document/templates/app/main.js4
-rwxr-xr-xjs/document/views/design.js8
5 files changed, 24 insertions, 7 deletions
diff --git a/js/document/document-html.js b/js/document/document-html.js
index b9c8e797..56f4e3d3 100755
--- a/js/document/document-html.js
+++ b/js/document/document-html.js
@@ -106,7 +106,8 @@ exports.HtmlDocument = Montage.create(Component, {
106 } 106 }
107 }, 107 },
108 handleViewReady: { 108 handleViewReady: {
109 value: function() { 109 value: function(mObjects) {
110 this.model.mObjects = mObjects;
110 // TODO: Find a better way to initialize this property 111 // TODO: Find a better way to initialize this property
111 // Assign the domContainer to be the document root on open 112 // Assign the domContainer to be the document root on open
112 if(typeof this.model.domContainer !== "undefined") { 113 if(typeof this.model.domContainer !== "undefined") {
diff --git a/js/document/models/base.js b/js/document/models/base.js
index 8ff52132..1daec5c0 100755
--- a/js/document/models/base.js
+++ b/js/document/models/base.js
@@ -95,6 +95,19 @@ exports.BaseDocumentModel = Montage.create(Component, {
95 libs: { 95 libs: {
96 value: null 96 value: null
97 }, 97 },
98
99 _mObjects: {
100 value: []
101 },
102
103 mObjects: {
104 get: function() {
105 return this._mObjects;
106 },
107 set: function(value) {
108 this._mObjects = value;
109 }
110 },
98 //////////////////////////////////////////////////////////////////// 111 ////////////////////////////////////////////////////////////////////
99 // 112 //
100 switchViewTo: { 113 switchViewTo: {
diff --git a/js/document/models/html.js b/js/document/models/html.js
index 4a232ee1..d9002b4e 100755
--- a/js/document/models/html.js
+++ b/js/document/models/html.js
@@ -68,9 +68,10 @@ exports.HtmlDocumentModel = Montage.create(BaseDocumentModel, {
68 // 68 //
69 webGlHelper: { 69 webGlHelper: {
70 value: null 70 value: null
71 }, 71 }
72 //////////////////////////////////////////////////////////////////// 72 ////////////////////////////////////////////////////////////////////
73 //////////////////////////////////////////////////////////////////// 73 ////////////////////////////////////////////////////////////////////
74
74}); 75});
75//////////////////////////////////////////////////////////////////////// 76////////////////////////////////////////////////////////////////////////
76//////////////////////////////////////////////////////////////////////// \ No newline at end of file 77//////////////////////////////////////////////////////////////////////// \ No newline at end of file
diff --git a/js/document/templates/app/main.js b/js/document/templates/app/main.js
index 8dc05ba5..0da1b87e 100644
--- a/js/document/templates/app/main.js
+++ b/js/document/templates/app/main.js
@@ -61,7 +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 64 componentInstance.identifier = data.identifier;
65 componentInstance.addEventListener("firstDraw", self, false); 65 componentInstance.addEventListener("firstDraw", self, false);
66 66
67 componentInstance.element = element; 67 componentInstance.element = element;
@@ -69,8 +69,6 @@ exports.Main = Montage.create(Component, {
69 componentInstance.ownerComponent = self; 69 componentInstance.ownerComponent = self;
70 70
71 self.componentToInsert = componentInstance; 71 self.componentToInsert = componentInstance;
72
73
74 callback(componentInstance, element); 72 callback(componentInstance, element);
75 }) 73 })
76 .end(); 74 .end();
diff --git a/js/document/views/design.js b/js/document/views/design.js
index d5c5c6c4..6a60e1f9 100755
--- a/js/document/views/design.js
+++ b/js/document/views/design.js
@@ -461,21 +461,25 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
461 initMontage: { 461 initMontage: {
462 value: function (scripttags) { 462 value: function (scripttags) {
463 var self = this; 463 var self = this;
464 // 464
465 this.iframe.contentWindow.document.body.addEventListener('mjsTemplateReady', function () { 465 this.iframe.contentWindow.document.body.addEventListener('mjsTemplateReady', function () {
466 //Initializing template with user's seriliazation 466 //Initializing template with user's seriliazation
467 var template = this.iframe.contentWindow.mjsTemplate.create(); 467 var template = this.iframe.contentWindow.mjsTemplate.create();
468
468 template.initWithDocument(this.iframe.contentWindow.document); 469 template.initWithDocument(this.iframe.contentWindow.document);
469 template.instantiateWithOwnerAndDocument(null, this.iframe.contentWindow.document, function (){ 470 template.instantiateWithOwnerAndDocument(null, this.iframe.contentWindow.document, function (){
470 //TODO: Verify this is properly done, seems like a hack 471 //TODO: Verify this is properly done, seems like a hack
472
473 var objArray = [];
471 for (var c in template._deserializer._objects) { 474 for (var c in template._deserializer._objects) {
472 //Forcing draw on components 475 //Forcing draw on components
473 template._deserializer._objects[c].needsDraw = true; 476 template._deserializer._objects[c].needsDraw = true;
477 objArray.push(template._deserializer._objects[c]);
474 } 478 }
475 479
476 // Now call the view callback 480 // Now call the view callback
477 if(self._viewCallback) { 481 if(self._viewCallback) {
478 self._viewCallback.viewCallback.call(self._viewCallback.context); 482 self._viewCallback.viewCallback.call(self._viewCallback.context, objArray);
479 } 483 }
480 484
481 }); 485 });