aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/css-panel')
-rw-r--r--js/panels/css-panel/css-style.reel/css-style.js13
-rw-r--r--js/panels/css-panel/styles-view-delegate.js10
2 files changed, 12 insertions, 11 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
diff --git a/js/panels/css-panel/styles-view-delegate.js b/js/panels/css-panel/styles-view-delegate.js
index 79ae35d1..a187a702 100644
--- a/js/panels/css-panel/styles-view-delegate.js
+++ b/js/panels/css-panel/styles-view-delegate.js
@@ -177,16 +177,6 @@ exports.StylesViewMediator = Montage.create(Component, {
177 return false; 177 return false;
178 } 178 }
179 179
180 ///// Auto-fill units if not provided and units
181 ///// not previously stored
182 units = style.getUnits(value);
183 if(style.units && units === null && parseInt(value)) {
184 value += style.units;
185 style.valueField.value = value;
186 } else if (value !== '0') {
187 style.units = units;
188 }
189
190 ///// update value 180 ///// update value
191 browserValue = this.stylesController.setStyle(rule, property, value); 181 browserValue = this.stylesController.setStyle(rule, property, value);
192 style.browserValue = browserValue; 182 style.browserValue = browserValue;