From e8c4e98c24092a360eb2f637983fd104fbb67f66 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Fri, 25 May 2012 11:22:05 -0700 Subject: Setup up Binding View Draw Cycle Signed-off-by: Armen Kesablyan --- .../binding-hud.reel/binding-hud.html | 8 ++---- js/stage/binding-view.reel/binding-view.html | 31 +++++++--------------- js/stage/binding-view.reel/binding-view.js | 25 ++++++++++++++++- 3 files changed, 36 insertions(+), 28 deletions(-) (limited to 'js') diff --git a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html index c81b70d3..1c73fd77 100755 --- a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html +++ b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html @@ -23,11 +23,7 @@ "element": {"#": "hudRepetition"} }, "bindings": { - "objects": { - "boundObject": {"@": "owner"}, - "boundObjectPropertyPath": "properties", - "oneway": true - } + "objects": {"<-": "@owner.properties"} } }, "hudOption": { @@ -36,7 +32,7 @@ "element": {"#" : "hudOption"} }, "bindings": { - "title": {"<-": "@objectAtCurrentIteration.title"} + "title": {"<-": "@repeater.objectAtCurrentIteration.title"} } } } diff --git a/js/stage/binding-view.reel/binding-view.html b/js/stage/binding-view.reel/binding-view.html index 152345d4..b77f8e27 100755 --- a/js/stage/binding-view.reel/binding-view.html +++ b/js/stage/binding-view.reel/binding-view.html @@ -24,17 +24,16 @@ "element": {"#": "hudRepeater"} }, "bindings": { - "objects": { - "boundObject": {"@": "owner"}, - "boundObjectPropertyPath": "bindables", - "oneway": true - } + "objects": {"<-": "@owner.bindables"} } }, "hud": { "prototype": "js/stage/binding-view.reel/binding-hud.reel", "properties": { "element": {"#" : "hud"} + }, + "bindings": { + "name": { } }, "nonVisualRepeater": { @@ -43,11 +42,7 @@ "element": {"#": "nonVisualRepeater"} }, "bindings": { - "objects": { - "boundObject": {"@": "owner"}, - "boundObjectPropertyPath": "nonVisualComponents", - "oneway": true - } + "objects": {"<-": "@owner.nonVisualComponents"} } }, "nonVisualComponent": { @@ -56,16 +51,8 @@ "element": {"#": "nonVisualComponent"} }, "bindings": { - "objectName": { - "boundObject": {"@": "hudRepeater"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.objectName", - "oneway": true - }, - "objectImage": { - "boundObject": {"@": "hudRepeater"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.objectImage", - "oneway": true - } + "objectName": {"<-": "@hudRepeater.objectAtCurrentIteration.objectName"}, + "objectImage": {"<-": "@hudRepeater.objectAtCurrentIteration.objectImage"} } } } @@ -82,7 +69,9 @@
-
+
+ +
diff --git a/js/stage/binding-view.reel/binding-view.js b/js/stage/binding-view.reel/binding-view.js index df3bc3ee..97593c66 100755 --- a/js/stage/binding-view.reel/binding-view.js +++ b/js/stage/binding-view.reel/binding-view.js @@ -34,6 +34,7 @@ exports.BindingView = Montage.create(Component, { }, set: function(val) { this._selectedElement = val; + this.needsDraw = true; } }, bindables: { @@ -51,9 +52,31 @@ exports.BindingView = Montage.create(Component, { set: function(val) { this._nonVisualComponents = val; } - } + }, //Methods + //Montage Draw Cycle + prepareForDraw: { + value: function() { + + } + }, + + draw: { + value: function() { + if(this.selectedElement !== null) { + this.bindables = [ + {"objectName": "Input1", "objectTitle": ""}, + ] + } + } + }, + + didDraw: { + value: function() { + + } + } }); \ No newline at end of file -- cgit v1.2.3