aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel/css-style.reel
diff options
context:
space:
mode:
authorEric Guzman2012-05-21 12:40:05 -0700
committerEric Guzman2012-05-21 12:40:05 -0700
commit1e6f46ba556ca3270c89fb848d93856804dd1cc8 (patch)
treee1e8601139ffa1b9f7d0e744f3a63a17e20e2dea /js/panels/css-panel/css-style.reel
parentf71e8f853605f0eb4deaf16263124aac1aad9ee1 (diff)
downloadninja-1e6f46ba556ca3270c89fb848d93856804dd1cc8.tar.gz
CSS Style Component - Moved unit identification to local change handler instead of delegate
Diffstat (limited to 'js/panels/css-panel/css-style.reel')
-rw-r--r--js/panels/css-panel/css-style.reel/css-style.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/js/panels/css-panel/css-style.reel/css-style.js b/js/panels/css-panel/css-style.reel/css-style.js
index dd84c7e9..331faa2f 100644
--- a/js/panels/css-panel/css-style.reel/css-style.js
+++ b/js/panels/css-panel/css-style.reel/css-style.js
@@ -15,6 +15,7 @@ exports.CssStyle = Montage.create(Component, {
15 invalidStyleClass : { value: "style-item-invalid" }, 15 invalidStyleClass : { value: "style-item-invalid" },
16 emptyStyleClass : { value: "empty-css-style" }, 16 emptyStyleClass : { value: "empty-css-style" },
17 source : { value: null }, 17 source : { value: null },
18 units : { value: null },
18 19
19 propertyText : { 20 propertyText : {
20 value: "property", 21 value: "property",
@@ -292,7 +293,17 @@ exports.CssStyle = Montage.create(Component, {
292 value: function(e) { 293 value: function(e) {
293 var property = this.propertyField.value, 294 var property = this.propertyField.value,
294 value = this.valueField.value, 295 value = this.valueField.value,
295 rule = this.getRule(); 296 rule = this.getRule(),
297 units;
298
299 ///// Auto-fill units if not provided and units
300 ///// not previously stored
301 units = this.getUnits(value);
302 if(this.units && units === null && parseInt(value)) {
303 value += this.units;
304 } else if (value !== '0') {
305 this.units = units;
306 }
296 307
297 this.valueText = value; 308 this.valueText = value;
298 309