From f2371c4a5a18a4dadb2e76f0275b90ac541e889d Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 22 Mar 2012 21:20:44 -0700 Subject: Adding enabled/disabled support for PI's checkbox control. Signed-off-by: Nivesh Rajbhandari --- js/panels/properties.reel/sections/custom.reel/custom.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'js/panels/properties.reel/sections/custom.reel') diff --git a/js/panels/properties.reel/sections/custom.reel/custom.js b/js/panels/properties.reel/sections/custom.reel/custom.js index 703ef950..ac316907 100755 --- a/js/panels/properties.reel/sections/custom.reel/custom.js +++ b/js/panels/properties.reel/sections/custom.reel/custom.js @@ -328,6 +328,19 @@ exports.CustomSection = Montage.create(Component, { if (aField.value) obj.label = aField.value; if (aField.prop) obj.prop = aField.prop; + if (aField.enabled) { + if(aField.enabled.boundObject) { + // TODO - For now, always bind to this.controls[someProperty] + Object.defineBinding(obj, "enabled", { + boundObject: this.controls, + boundObjectPropertyPath: aField.enabled.boundProperty, + oneway: false + }); + } else { + obj.enabled = aField.enabled; + } + } + //Initiate onChange Events obj.addEventListener("change", this, false); -- cgit v1.2.3