From 337efc667372326ae2f9984d89a47bb151016774 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Mon, 11 Jun 2012 13:25:13 -0700 Subject: Changes Made to Object Listing of iFrame Signed-off-by: Armen Kesablyan --- js/controllers/objects-controller.js | 10 +++++----- js/document/document-html.js | 3 ++- js/document/models/base.js | 13 +++++++++++++ js/document/models/html.js | 3 ++- js/document/views/design.js | 6 ++++-- js/ninja.reel/ninja.html | 3 ++- js/ninja.reel/ninja.js | 8 ++++++++ js/panels/PanelContainer.reel/PanelContainer.html | 6 ++++++ 8 files changed, 42 insertions(+), 10 deletions(-) diff --git a/js/controllers/objects-controller.js b/js/controllers/objects-controller.js index 2ce10e82..fd9b12f4 100644 --- a/js/controllers/objects-controller.js +++ b/js/controllers/objects-controller.js @@ -45,11 +45,11 @@ var objectsController = exports.ObjectsController = Montage.create(Component, { this._isBoundToModelObjects = true; } - Object.defineBinding(this, 'objects', { - boundObject: this.currentDocument.model, - boundObjectPropertyPath: 'objects', - oneway: false - }); +// Object.defineBinding(this, 'objects', { +// boundObject: this.currentDocument.model, +// boundObjectPropertyPath: 'mObjects', +// oneway: false +// }); } }, diff --git a/js/document/document-html.js b/js/document/document-html.js index 04565753..8b82c40f 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -106,7 +106,8 @@ exports.HtmlDocument = Montage.create(Component, { } }, handleViewReady: { - value: function() { + value: function(mObjects) { + this.model.mObjects = mObjects; //Making callback after view is loaded this.loaded.callback.call(this.loaded.context, this); } diff --git a/js/document/models/base.js b/js/document/models/base.js index 5fa06259..9c26bd2a 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js @@ -91,6 +91,19 @@ exports.BaseDocumentModel = Montage.create(Component, { libs: { value: null }, + + _mObjects: { + value: [] + }, + + mObjects: { + get: function() { + return this._mObjects; + }, + set: function(value) { + this._mObjects = value; + } + }, //////////////////////////////////////////////////////////////////// // switchViewTo: { diff --git a/js/document/models/html.js b/js/document/models/html.js index 7064c6e3..f65cd8c3 100755 --- a/js/document/models/html.js +++ b/js/document/models/html.js @@ -73,9 +73,10 @@ exports.HtmlDocumentModel = Montage.create(BaseDocumentModel, { // webGlHelper: { value: null - }, + } //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// + }); //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/js/document/views/design.js b/js/document/views/design.js index dad6de8b..4484167a 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js @@ -450,15 +450,17 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { template.initWithDocument(this.iframe.contentWindow.document); template.instantiateWithOwnerAndDocument(null, this.iframe.contentWindow.document, function (){ //TODO: Verify this is properly done, seems like a hack + + var objArray = []; for (var c in template._deserializer._objects) { //Forcing draw on components template._deserializer._objects[c].needsDraw = true; - //this.model.objects = template.deserializer.getObjectsFromLastDeserialization(); + objArray.push(template._deserializer._objects[c]); } // Now call the view callback if(self._viewCallback) { - self._viewCallback.viewCallback.call(self._viewCallback.context); + self._viewCallback.viewCallback.call(self._viewCallback.context, objArray); } }); diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index 221e492c..11f7c53e 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html @@ -363,7 +363,8 @@ "objectsController" : { "prototype": "js/controllers/objects-controller", "bindings": { - "currentDocument": {"<-": "@owner.currentDocument"} + "currentDocument": {"<-": "@documentList.selectedObjects.0"}, + "objects": {"<-": "@documentList.selectedObjects.0.model.mObjects"} } }, diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 5f753bd3..fe20447a 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -23,6 +23,9 @@ exports.Ninja = Montage.create(Component, { value: null }, + appData: { + value: AppData + }, documentList: { value: null @@ -57,9 +60,14 @@ exports.Ninja = Montage.create(Component, { } }, + _isResizing: { + value: null + }, + _resizedHeight : { value: 0 }, + _height: { value: null }, diff --git a/js/panels/PanelContainer.reel/PanelContainer.html b/js/panels/PanelContainer.reel/PanelContainer.html index 7d7444c5..9842a1d1 100755 --- a/js/panels/PanelContainer.reel/PanelContainer.html +++ b/js/panels/PanelContainer.reel/PanelContainer.html @@ -88,6 +88,9 @@ "prototype": "js/panels/Panel.reel", "properties": { "element": {"#": "panel_7"} + }, + "bindings": { + "currentDocument": {"<-": "@owner.currentDocument"} } }, @@ -95,6 +98,9 @@ "prototype": "js/panels/Panel.reel", "properties": { "element": {"#": "panel_8"} + }, + "bindings": { + "currentDocument": {"<-": "@owner.currentDocument"} } }, -- cgit v1.2.3