diff options
author | Nivesh Rajbhandari | 2012-05-17 15:43:40 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-05-17 15:43:40 -0700 |
commit | 43994432117686f18eb1783418ef83744ae01d79 (patch) | |
tree | 3fcdef7c4123d2efd58986b71d34b8dc7ada5f0a /js/components/tools-properties/rect-properties.reel/rect-properties.js | |
parent | 6ce2f2a5af1bc66d8dbec04abfae2e07f43afcfe (diff) | |
download | ninja-43994432117686f18eb1783418ef83744ae01d79.tar.gz |
Fixed border radius hot-text linking that was broken by update to montage v.10.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/components/tools-properties/rect-properties.reel/rect-properties.js')
-rwxr-xr-x | js/components/tools-properties/rect-properties.reel/rect-properties.js | 79 |
1 files changed, 32 insertions, 47 deletions
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, { | |||
19 | 19 | ||
20 | _subPrepare: { | 20 | _subPrepare: { |
21 | value: function() { | 21 | value: function() { |
22 | this.lockButton.identifier = "lockButton"; | ||
23 | this.lockButton.addEventListener("action", this, false); | ||
24 | |||
25 | this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); | ||
26 | this._setCap([this.TLRadiusControl,this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); | ||
27 | |||
28 | } | 22 | } |
29 | }, | 23 | }, |
30 | 24 | ||
@@ -33,11 +27,8 @@ exports.RectProperties = Montage.create(ToolProperties, { | |||
33 | this.TRRadiusControl.enabled = this.BLRadiusControl.enabled = this.BRRadiusControl.enabled = !this.lockButton.pressed; | 27 | this.TRRadiusControl.enabled = this.BLRadiusControl.enabled = this.BRRadiusControl.enabled = !this.lockButton.pressed; |
34 | 28 | ||
35 | if(this.lockButton.pressed) { | 29 | if(this.lockButton.pressed) { |
36 | this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); | 30 | this._syncRadii(this.TLRadiusControl.value, this.TLRadiusControl.units); |
37 | } else { | ||
38 | this._removeBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); | ||
39 | } | 31 | } |
40 | |||
41 | } | 32 | } |
42 | }, | 33 | }, |
43 | 34 | ||
@@ -80,57 +71,51 @@ exports.RectProperties = Montage.create(ToolProperties, { | |||
80 | get: function() { return this.base._fillMaterial.value; } | 71 | get: function() { return this.base._fillMaterial.value; } |
81 | }, | 72 | }, |
82 | 73 | ||
83 | _setBindings: { | 74 | handleChanging: { |
84 | value: function(els) { | 75 | value: function(event) { |
85 | var that = this; | 76 | if(event.wasSetByCode) { |
86 | els.forEach(function(el) { | 77 | return; |
87 | Object.defineBinding(el, "value", { | 78 | } |
88 | boundObject: that.TLRadiusControl, | ||
89 | boundObjectPropertyPath: "value", | ||
90 | boundValueMutator: function(value) { | ||
91 | if (typeof value === "string") { | ||
92 | return parseFloat(value); | ||
93 | } | ||
94 | |||
95 | return value; | ||
96 | } | ||
97 | }); | ||
98 | |||
99 | Object.defineBinding(el, "units", { | ||
100 | boundObject: that.TLRadiusControl, | ||
101 | boundObjectPropertyPath: "units" | ||
102 | }); | ||
103 | }); | ||
104 | } | ||
105 | }, | ||
106 | 79 | ||
107 | _removeBindings: { | 80 | this._setBorderRadius(event); |
108 | value: function(els) { | ||
109 | els.forEach(function(el) { | ||
110 | Object.deleteBindings(el); | ||
111 | }); | ||
112 | } | 81 | } |
113 | }, | 82 | }, |
114 | 83 | ||
115 | _setCap: { | 84 | handleChange: { |
116 | value: function(els) { | 85 | value: function(event) { |
117 | var that = this; | 86 | if(event.wasSetByCode) { |
118 | els.forEach(function(el) { | 87 | return; |
119 | el.addEventListener("change", that, false); | 88 | } |
120 | }); | 89 | |
90 | this._setBorderRadius(event); | ||
121 | } | 91 | } |
122 | }, | 92 | }, |
123 | 93 | ||
124 | handleChange: { | 94 | _setBorderRadius: { |
125 | value: function(event) { | 95 | value: function(event) { |
126 | var hotTxt = event.currentTarget; | 96 | var hotTxt = event.currentTarget; |
127 | if(hotTxt.units === "%") { | 97 | if(hotTxt.units === "%") { |
128 | if(hotTxt.value > 50) { | 98 | if(hotTxt.value > 50) { |
129 | hotTxt.maxValue = 50; | 99 | hotTxt.maxValue = 50; |
130 | } | 100 | } |
131 | return hotTxt.value; | ||
132 | } | 101 | } |
133 | 102 | ||
103 | if(this.lockButton.pressed && (this.TLRadiusControl === hotTxt)) { | ||
104 | this._syncRadii(hotTxt.value, hotTxt.units); | ||
105 | } | ||
106 | } | ||
107 | }, | ||
108 | |||
109 | _syncRadii: { | ||
110 | value: function(value, units) { | ||
111 | this.TRRadiusControl.value = value; | ||
112 | this.BLRadiusControl.value = value; | ||
113 | this.BRRadiusControl.value = value; | ||
114 | |||
115 | this.TRRadiusControl.units = units; | ||
116 | this.BLRadiusControl.units = units; | ||
117 | this.BRRadiusControl.units = units; | ||
134 | } | 118 | } |
135 | } | 119 | } |
120 | |||
136 | }); \ No newline at end of file | 121 | }); \ No newline at end of file |