From 95bef3bbd77c6c3bd01b5222986f2dd35a7218b4 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Sat, 19 May 2012 14:48:35 -0700 Subject: Changes to binding view Signed-off-by: Armen Kesablyan --- js/controllers/objects-controller.js | 6 ----- js/document/templates/html/index.html | 5 +++- js/ninja.reel/ninja.html | 5 +++- js/stage/binding-view.reel/binding-view.html | 36 ++++++++++++++++++++++++++-- js/stage/binding-view.reel/binding-view.js | 10 ++++++++ 5 files changed, 52 insertions(+), 10 deletions(-) (limited to 'js') diff --git a/js/controllers/objects-controller.js b/js/controllers/objects-controller.js index 70a3974c..543aa96f 100644 --- a/js/controllers/objects-controller.js +++ b/js/controllers/objects-controller.js @@ -16,12 +16,6 @@ var objectsController = exports.ObjectsController = Montage.create(Component, { value: function() { ///// Bind app's activeDocument property to ///// objects controller's _activeDocument property - - Object.defineBinding(this, "activeDocument", { - boundObject: this.application.ninja, - boundObjectPropertyPath: "currentDocument", - oneway: true - }); } }, diff --git a/js/document/templates/html/index.html b/js/document/templates/html/index.html index 933df157..1bd3da1b 100755 --- a/js/document/templates/html/index.html +++ b/js/document/templates/html/index.html @@ -67,7 +67,10 @@ diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index 12dbf660..1f0582b1 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html @@ -324,7 +324,10 @@ }, "objectsController" : { - "prototype": "js/controllers/objects-controller" + "prototype": "js/controllers/objects-controller", + "bindings": { + "activeDocument": {"<-": "@owner.currentDocument"} + } }, "owner": { diff --git a/js/stage/binding-view.reel/binding-view.html b/js/stage/binding-view.reel/binding-view.html index e3495542..43fa0112 100755 --- a/js/stage/binding-view.reel/binding-view.html +++ b/js/stage/binding-view.reel/binding-view.html @@ -14,10 +14,11 @@ "owner": { "prototype": "js/stage/binding-view.reel", "properties": { - "element": {"#": "bindingView"} + "element": {"#": "bindingView"}, + "hudRepeater": {"@": "hudRepeater"} } }, - "repeater": { + "hudRepeater": { "prototype": "montage/ui/repetition.reel", "properties": { "element": {"#": "hudRepetition"} @@ -35,6 +36,37 @@ "properties": { "element": {"#" : "hud"} } + }, + "nonVisualRepeater": { + "prototype": "montage/ui/repetition.reel", + "properties": { + "element": {"#": "nonVisualRepeater"} + }, + "bindings": { + "objects": { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "nonVisualComponents", + "oneway": true + } + } + }, + "nonVisualComponent": { + "prototype": "js/stage/binding-view.reel/non-visual-component.reel", + "properties": { + "element": {"#": "nonVisualComponent"} + }, + "bindings": { + "objectName": { + "boundObject": {"@": "hudRepetition"}, + "boundObjectPropertyPath": "objectAtCurrentIteration.objectName", + "oneway": true + }, + "objectImage": { + "boundObject": {"@": "undoList"}, + "boundObjectPropertyPath": "objectAtCurrentIteration.objectImage", + "oneway": true + } + } } } diff --git a/js/stage/binding-view.reel/binding-view.js b/js/stage/binding-view.reel/binding-view.js index 4daa85b3..d3d988c1 100755 --- a/js/stage/binding-view.reel/binding-view.js +++ b/js/stage/binding-view.reel/binding-view.js @@ -22,5 +22,15 @@ exports.bindingView = Montage.create(Component, { set: function(val) { this._bindables = val; } + }, + + + nonVisualComponents: { + get: function() { + return this._bindables; + }, + set: function(val) { + this._bindables = val; + } } }); \ No newline at end of file -- cgit v1.2.3