Browse Source

Update Property

up-style-manager
Artur Arseniev 5 years ago
parent
commit
2e93a98941
  1. 8
      src/style_manager/model/Property.js
  2. 2
      src/style_manager/model/PropertyRadio.js

8
src/style_manager/model/Property.js

@ -90,11 +90,15 @@ export default class Property extends Model {
/** /**
* Check if the property has value * Check if the property has value
* @param {Object} [opts={}] Options
* @param {Boolean} [opts.noParent=false] Ignore the value if from parent target.
* @returns {Boolean} * @returns {Boolean}
*/ */
hasValue() { hasValue(opts = {}) {
const { noParent } = opts;
const parentValue = noParent && this.getParentTarget();
const val = this.get('value'); const val = this.get('value');
return !isUndefined(val) && val !== ''; return !isUndefined(val) && val !== '' && !parentValue;
} }
/** /**

2
src/style_manager/model/PropertyRadio.js

@ -16,7 +16,7 @@ export default class PropertyRadio extends Property {
getOptions() { getOptions() {
// support old list property // support old list property
const { options, list } = this.attributes; const { options, list } = this.attributes;
return options && options.length ? options : list; return (options && options.length ? options : list) || [];
} }
/** /**

Loading…
Cancel
Save