Browse Source

Update Property

up-style-manager
Artur Arseniev 5 years ago
parent
commit
86cc86f904
  1. 9
      src/style_manager/model/Property.js

9
src/style_manager/model/Property.js

@ -82,9 +82,10 @@ export default class Property extends Model {
* Get property value. * Get property value.
* @returns {String} * @returns {String}
*/ */
getValue() { getValue(opts = {}) {
const { noDefault } = opts;
const val = this.get('value'); const val = this.get('value');
return !this.hasValue() ? this.getDefaultValue() : val; return !this.hasValue() && !noDefault ? this.getDefaultValue() : val;
} }
/** /**
@ -105,7 +106,9 @@ export default class Property extends Model {
upValue(value, opts) { upValue(value, opts) {
const parsed = const parsed =
value === null ? this.__getClearProps() : this.parseValue(value); value === null || value === ''
? this.__getClearProps()
: this.parseValue(value);
return this._up(parsed, opts); return this._up(parsed, opts);
} }

Loading…
Cancel
Save