Browse Source

Fix style manager with rules containing !important. Closes #4719

pull/4746/head
Artur Arseniev 4 years ago
parent
commit
d95a35de1c
  1. 4
      src/style_manager/model/Property.js
  2. 2
      src/style_manager/view/PropertyView.js

4
src/style_manager/model/Property.js

@ -362,7 +362,7 @@ export default class Property extends Model {
* @return {string}
* @private
*/
getFullValue(val) {
getFullValue(val, opts = {}) {
const fn = this.get('functionName');
const def = this.getDefaultValue();
let value = isUndefined(val) ? this.get('value') : val;
@ -377,7 +377,7 @@ export default class Property extends Model {
value = `${fn}(${fnParameter})`;
}
if (hasValue && this.get('important')) {
if (hasValue && this.get('important') && !opts.skipImportant) {
value = `${value} !important`;
}

2
src/style_manager/view/PropertyView.js

@ -127,7 +127,7 @@ export default class Property extends View {
}
onValueChange(m, val, opt = {}) {
this.setValue(this.model.getFullValue());
this.setValue(this.model.getFullValue(undefined, { skipImportant: true }));
this.updateStatus();
}

Loading…
Cancel
Save