Browse Source

Add hasValue method to Property

up-style-manager
Artur Arseniev 4 years ago
parent
commit
83fa7205bc
  1. 11
      src/style_manager/model/Property.js

11
src/style_manager/model/Property.js

@ -84,7 +84,16 @@ export default class Property extends Model {
*/
getValue() {
const val = this.get('value');
return isUndefined(val) || val === '' ? this.getDefaultValue() : val;
return !this.hasValue() ? this.getDefaultValue() : val;
}
/**
* Check if the property has value
* @returns {Boolean}
*/
hasValue() {
const val = this.get('value');
return !isUndefined(val) && val !== '';
}
/**

Loading…
Cancel
Save