From a183eff03cef60840ed360b3c9fc750b923a0a6b Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 2 May 2012 17:12:58 -0700 Subject: CSS Panel - Fix issue with wrong style value when re-enabling style. --- js/panels/css-panel/style.reel/style.js | 3 +++ js/panels/css-panel/styles-view-delegate.js | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/js/panels/css-panel/style.reel/style.js b/js/panels/css-panel/style.reel/style.js index 1d5a11a5..858b7020 100644 --- a/js/panels/css-panel/style.reel/style.js +++ b/js/panels/css-panel/style.reel/style.js @@ -25,6 +25,9 @@ exports.Style = Montage.create(TreeNode, { this.units = this.getUnits(text); } }, + browserValue: { + value: null + }, _priority: { value: "", distinct: true }, priority: { get: function() { diff --git a/js/panels/css-panel/styles-view-delegate.js b/js/panels/css-panel/styles-view-delegate.js index 7e0987eb..ec0026a1 100644 --- a/js/panels/css-panel/styles-view-delegate.js +++ b/js/panels/css-panel/styles-view-delegate.js @@ -94,7 +94,7 @@ exports.StylesViewMediator = Montage.create(Component, { handleStyleToggle : { value: function(rule, enable, style) { if(enable) { - this.stylesController.setStyle(rule, style.propertyText, style.valueText, style.priority); + this.stylesController.setStyle(rule, style.propertyText, style.browserValue, style.priority); } else { this.stylesController.deleteStyle(rule, style.propertyText); } @@ -203,6 +203,7 @@ exports.StylesViewMediator = Montage.create(Component, { ///// update value browserValue = this.stylesController.setStyle(rule, property, value); + style.browserValue = browserValue; ///// Mark style as invalid if the browser doesn't accept it style.invalid = (browserValue === null); -- cgit v1.2.3