From 4c3aac5eabd93052b1554a03d78235215bb49db4 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 29 May 2012 00:34:40 -0700 Subject: document bindings phase 1 - using array controller to bind the current document to all ninja components - removed open document event - removed references to the document controller Signed-off-by: Valerio Virgillito --- js/components/menu/menu-item.reel/menu-item.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/components/menu/menu-item.reel') diff --git a/js/components/menu/menu-item.reel/menu-item.js b/js/components/menu/menu-item.reel/menu-item.js index fc3913b8..9c18ed37 100755 --- a/js/components/menu/menu-item.reel/menu-item.js +++ b/js/components/menu/menu-item.reel/menu-item.js @@ -82,7 +82,7 @@ exports.MenuItem = Montage.create(Component, { }); } - +/* if(this.data.enabled.boundProperty) { boundObject = this.application.ninja[this.data.enabled.boundObj]; @@ -95,9 +95,11 @@ exports.MenuItem = Montage.create(Component, { }); } else { + */ this.enabled = this.data.enabled; + /* } - + */ if(this.data.submenu) { this.submenu = true; -- cgit v1.2.3 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-item.reel/menu-item.html | 13 +++---------- js/components/menu/menu-item.reel/menu-item.js | 20 +------------------- 2 files changed, 4 insertions(+), 29 deletions(-) (limited to 'js/components/menu/menu-item.reel') 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; -- cgit v1.2.3