From a0daa3668883c8c35ce277b60509a3a3dcf303b2 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 24 Apr 2012 11:42:42 -0700 Subject: Allow users to toggle application of stroke and border settings when using the ink bottle tool. Signed-off-by: Nivesh Rajbhandari --- .../ink-bottle-properties.js | 49 +++++++++++++++------- 1 file changed, 34 insertions(+), 15 deletions(-) (limited to 'js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js') diff --git a/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js b/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js index e3ffc359..6d5c46f6 100755 --- a/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js +++ b/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.js @@ -10,8 +10,6 @@ var Montage = require("montage/core/core").Montage, exports.InkBottleProperties = Montage.create(ToolProperties, { - _use3D: { value: false }, - _subPrepare: { value: function() { Object.defineBinding(this._strokeMaterial, "items", { @@ -19,23 +17,44 @@ exports.InkBottleProperties = Montage.create(ToolProperties, { boundObjectPropertyPath: "materials", oneway: false }); - - this.handleChange(null); - this._useWebGL.addEventListener("change", this, false); } }, - handleChange: { + handleAction: { value: function(event) { - if(this._useWebGL.checked) - { - this._use3D = true; - this._materialsContainer.style["display"] = ""; - } - else - { - this._use3D = false; - this._materialsContainer.style["display"] = "none"; + var ch = event.currentTarget, + val = event.currentTarget.identifier; + switch(val) { + case "useBorderWidth": + if(ch.checked) { + this.borderWidthLabel.element.classList.remove("disabled"); + this._borderWidth.enabled = true; + } else { + this.borderWidthLabel.element.classList.add("disabled"); + this._borderWidth.enabled = false; + } + break; + case "useBorderStyle": + if(ch.checked) { + this.borderStyleLabel.element.classList.remove("disabled"); + this._borderStyle.removeAttribute("disabled") + } else { + this.borderStyleLabel.element.classList.add("disabled"); + this._borderStyle.setAttribute("disabled", "disabled"); + } + break; + case "useStrokeSize": + if(ch.checked) { + this.strokeSizeLabel.element.classList.remove("disabled"); + this._strokeSize.enabled = true + } else { + this.strokeSizeLabel.element.classList.add("disabled"); + this._strokeSize.enabled = false; + } + break; + case "useWebGl": + (ch.checked) ? this._materialsContainer.style["display"] = "" : this._materialsContainer.style["display"] = "none"; + break; } } } -- cgit v1.2.3