From d8840eda0d3b3e31fb5a72306fe66608f4f99c2b Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 29 May 2012 23:52:59 -0700 Subject: fixing the menu bindings and some cleanup of the stage Signed-off-by: Valerio Virgillito --- js/components/menu/menu-entry.reel/menu-entry.html | 13 +- js/components/menu/menu-item.reel/menu-item.html | 13 +- js/components/menu/menu-item.reel/menu-item.js | 20 +-- js/components/menu/menu.reel/menu.html | 5 +- js/components/menu/menu.reel/menu.js | 17 +++ js/data/menu-data.js | 147 +++++++++++++-------- js/ninja.reel/ninja.html | 3 + js/stage/stage.reel/stage.js | 9 +- 8 files changed, 125 insertions(+), 102 deletions(-) diff --git a/js/components/menu/menu-entry.reel/menu-entry.html b/js/components/menu/menu-entry.reel/menu-entry.html index cd013a4e..f64de3cb 100755 --- a/js/components/menu/menu-entry.reel/menu-entry.html +++ b/js/components/menu/menu-entry.reel/menu-entry.html @@ -17,11 +17,7 @@ "automaticallyOrganizeObjects": false }, "bindings": { - "content": { - "boundObject": {"@": "owner"}, - "boundObjectPropertyPath": "data.entries", - "oneway": true - } + "content": {"<-": "@owner.data.entries"} } }, @@ -39,11 +35,8 @@ "element": { "#": "menuEntryItem" } }, "bindings": { - "data": { - "boundObject": {"@": "repetition"}, - "boundObjectPropertyPath": "objectAtCurrentIteration", - "oneway": true - } + "data": {"<-": "@repetition.objectAtCurrentIteration"}, + "enabled": {"<-": "@repetition.objectAtCurrentIteration.enabled"} } }, diff --git a/js/components/menu/menu-item.reel/menu-item.html b/js/components/menu/menu-item.reel/menu-item.html index 5ff8c0fc..1902833a 100755 --- a/js/components/menu/menu-item.reel/menu-item.html +++ b/js/components/menu/menu-item.reel/menu-item.html @@ -17,11 +17,7 @@ "automaticallyOrganizeObjects": false }, "bindings": { - "content": { - "boundObject": {"@": "owner"}, - "boundObjectPropertyPath": "subentries", - "oneway": true - } + "content": {"<-": "@owner.subentries"} } }, @@ -39,11 +35,8 @@ "element": {"#": "menuEntryItem" } }, "bindings": { - "data": { - "boundObject": {"@": "repetition"}, - "boundObjectPropertyPath": "objectAtCurrentIteration", - "oneway": true - } + "data": {"<-": "@repetition.objectAtCurrentIteration"}, + "enabled": {"<-": "@repetition.objectAtCurrentIteration.enabled"} } }, diff --git a/js/components/menu/menu-item.reel/menu-item.js b/js/components/menu/menu-item.reel/menu-item.js index 9c18ed37..c00c4412 100755 --- a/js/components/menu/menu-item.reel/menu-item.js +++ b/js/components/menu/menu-item.reel/menu-item.js @@ -14,7 +14,7 @@ exports.MenuItem = Montage.create(Component, { }, _enabled: { - value: null + value: false }, enabled: { @@ -61,7 +61,6 @@ exports.MenuItem = Montage.create(Component, { prepareForDraw: { value: function() { - var boundObject = this.application.ninja, strArr = null, i=0; if(!this.data) return; @@ -82,24 +81,7 @@ exports.MenuItem = Montage.create(Component, { }); } -/* - if(this.data.enabled.boundProperty) { - - boundObject = this.application.ninja[this.data.enabled.boundObj]; - - Object.defineBinding(this, "enabled", { - boundObject: boundObject, - boundObjectPropertyPath: this.data.enabled.boundProperty, - boundValueMutator: this.data.enabled.boundValueMutator, - oneway : this.data.enabled.oneway - }); - } else { - */ - this.enabled = this.data.enabled; - /* - } - */ if(this.data.submenu) { this.submenu = true; diff --git a/js/components/menu/menu.reel/menu.html b/js/components/menu/menu.reel/menu.html index 7f2aeeef..f15cf119 100755 --- a/js/components/menu/menu.reel/menu.html +++ b/js/components/menu/menu.reel/menu.html @@ -12,7 +12,10 @@