diff options
author | Eric Guzman | 2012-05-18 17:27:31 -0700 |
---|---|---|
committer | Eric Guzman | 2012-05-18 17:27:31 -0700 |
commit | 13da56e791b7478ad3dbb8162a583a6b2c8c4b6b (patch) | |
tree | 3cdef0e1cc56507f2f14a715c19d207cbc0ef3af /js/panels/css-panel/styles-view-delegate.js | |
parent | e5f3f24f249ab5d2e260425d774c27f710be43bf (diff) | |
download | ninja-13da56e791b7478ad3dbb8162a583a6b2c8c4b6b.tar.gz |
Style Declaration - Handle removing styles
Removed sorting and had to put a null check in the style component because the valueText was being set to undefined and causing an error. Check with montage on why that is happening.
Diffstat (limited to 'js/panels/css-panel/styles-view-delegate.js')
-rw-r--r-- | js/panels/css-panel/styles-view-delegate.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/js/panels/css-panel/styles-view-delegate.js b/js/panels/css-panel/styles-view-delegate.js index 38b0fcc6..b5efc18c 100644 --- a/js/panels/css-panel/styles-view-delegate.js +++ b/js/panels/css-panel/styles-view-delegate.js | |||
@@ -145,14 +145,16 @@ exports.StylesViewMediator = Montage.create(Component, { | |||
145 | return false; | 145 | return false; |
146 | } | 146 | } |
147 | 147 | ||
148 | ///// Remove old property | ||
149 | this.stylesController.deleteStyle(rule, oldProperty); | ||
150 | |||
148 | if(property === '') { | 151 | if(property === '') { |
149 | style.remove(); | 152 | style.parentComponent.parentComponent.removeStyle(style.source); |
150 | this._dispatchChange(oldProperty, browserValue); | 153 | this._dispatchChange(oldProperty, browserValue); |
151 | return false; | 154 | return false; |
152 | } | 155 | } |
153 | 156 | ||
154 | ///// Remove old property and add new one | 157 | // now add new property |
155 | this.stylesController.deleteStyle(rule, oldProperty); | ||
156 | browserValue = this.stylesController.setStyle(rule, property, value); | 158 | browserValue = this.stylesController.setStyle(rule, property, value); |
157 | 159 | ||
158 | ///// Mark style as invalid if the browser doesn't accept it | 160 | ///// Mark style as invalid if the browser doesn't accept it |
@@ -166,7 +168,9 @@ exports.StylesViewMediator = Montage.create(Component, { | |||
166 | var browserValue, units; | 168 | var browserValue, units; |
167 | 169 | ||
168 | if(value === '') { | 170 | if(value === '') { |
169 | style.remove(); | 171 | ///// Remove old property |
172 | this.stylesController.deleteStyle(rule, property); | ||
173 | style.parentComponent.parentComponent.removeStyle(style.source); | ||
170 | this._dispatchChange(property, browserValue); | 174 | this._dispatchChange(property, browserValue); |
171 | return false; | 175 | return false; |
172 | } | 176 | } |