From 1a759361b82127f9d5c1428dc889fffdf2daaf86 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Thu, 3 May 2012 15:11:56 -0700 Subject: First round of moving color chips into the sub tools. Shape and Pen tool now have chips in the sub tool bar. Still need to complete adding chips to the Brush tool and finalizing the subtool bar layout to our spec for all of the subtools. --- .../tools-properties/rect-properties.reel/rect-properties.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'js/components/tools-properties/rect-properties.reel/rect-properties.js') diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.js b/js/components/tools-properties/rect-properties.reel/rect-properties.js index f023f4bb..c1cb3945 100755 --- a/js/components/tools-properties/rect-properties.reel/rect-properties.js +++ b/js/components/tools-properties/rect-properties.reel/rect-properties.js @@ -42,6 +42,14 @@ exports.RectProperties = Montage.create(ToolProperties, { }, // Public API + fill: { + get: function () { return this.base.fill; } + }, + + stroke: { + get: function () { return this.base.stroke; } + }, + use3D: { get: function() { return this.base._use3D; } }, @@ -125,6 +133,4 @@ exports.RectProperties = Montage.create(ToolProperties, { } } - - }); \ No newline at end of file -- cgit v1.2.3 From 43994432117686f18eb1783418ef83744ae01d79 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 17 May 2012 15:43:40 -0700 Subject: Fixed border radius hot-text linking that was broken by update to montage v.10. Signed-off-by: Nivesh Rajbhandari --- .../rect-properties.reel/rect-properties.js | 79 +++++++++------------- 1 file changed, 32 insertions(+), 47 deletions(-) (limited to 'js/components/tools-properties/rect-properties.reel/rect-properties.js') diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.js b/js/components/tools-properties/rect-properties.reel/rect-properties.js index c1cb3945..2f8ea4dd 100755 --- a/js/components/tools-properties/rect-properties.reel/rect-properties.js +++ b/js/components/tools-properties/rect-properties.reel/rect-properties.js @@ -19,12 +19,6 @@ exports.RectProperties = Montage.create(ToolProperties, { _subPrepare: { value: function() { - this.lockButton.identifier = "lockButton"; - this.lockButton.addEventListener("action", this, false); - - this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); - this._setCap([this.TLRadiusControl,this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); - } }, @@ -33,11 +27,8 @@ exports.RectProperties = Montage.create(ToolProperties, { this.TRRadiusControl.enabled = this.BLRadiusControl.enabled = this.BRRadiusControl.enabled = !this.lockButton.pressed; if(this.lockButton.pressed) { - this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); - } else { - this._removeBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); + this._syncRadii(this.TLRadiusControl.value, this.TLRadiusControl.units); } - } }, @@ -80,57 +71,51 @@ exports.RectProperties = Montage.create(ToolProperties, { get: function() { return this.base._fillMaterial.value; } }, - _setBindings: { - value: function(els) { - var that = this; - els.forEach(function(el) { - Object.defineBinding(el, "value", { - boundObject: that.TLRadiusControl, - boundObjectPropertyPath: "value", - boundValueMutator: function(value) { - if (typeof value === "string") { - return parseFloat(value); - } - - return value; - } - }); - - Object.defineBinding(el, "units", { - boundObject: that.TLRadiusControl, - boundObjectPropertyPath: "units" - }); - }); - } - }, + handleChanging: { + value: function(event) { + if(event.wasSetByCode) { + return; + } - _removeBindings: { - value: function(els) { - els.forEach(function(el) { - Object.deleteBindings(el); - }); + this._setBorderRadius(event); } }, - _setCap: { - value: function(els) { - var that = this; - els.forEach(function(el) { - el.addEventListener("change", that, false); - }); + handleChange: { + value: function(event) { + if(event.wasSetByCode) { + return; + } + + this._setBorderRadius(event); } }, - handleChange: { + _setBorderRadius: { value: function(event) { var hotTxt = event.currentTarget; if(hotTxt.units === "%") { if(hotTxt.value > 50) { hotTxt.maxValue = 50; } - return hotTxt.value; } - + + if(this.lockButton.pressed && (this.TLRadiusControl === hotTxt)) { + this._syncRadii(hotTxt.value, hotTxt.units); + } + } + }, + + _syncRadii: { + value: function(value, units) { + this.TRRadiusControl.value = value; + this.BLRadiusControl.value = value; + this.BRRadiusControl.value = value; + + this.TRRadiusControl.units = units; + this.BLRadiusControl.units = units; + this.BRRadiusControl.units = units; } } + }); \ No newline at end of file -- cgit v1.2.3