diff --git a/src/dom_components/model/Component.js b/src/dom_components/model/Component.js index b14ec8b5f..b866a3b6c 100644 --- a/src/dom_components/model/Component.js +++ b/src/dom_components/model/Component.js @@ -107,6 +107,20 @@ define(['backbone','./Components', 'SelectorManager/model/Selectors', 'TraitMana traits.add(this.get('traits')); this.set('traits', traits); this.initToolbar(); + + // Normalize few properties from strings to arrays + var toNormalize = ['stylable']; + toNormalize.forEach(function(name) { + var value = this.get(name); + + if (typeof value == 'string') { + var newValue = value.split(',').map(function(prop) { + return prop.trim(); + }); + this.set(name, newValue); + } + }, this); + this.init(); }, diff --git a/src/style_manager/view/PropertyView.js b/src/style_manager/view/PropertyView.js index 627d848f8..83130a96b 100644 --- a/src/style_manager/view/PropertyView.js +++ b/src/style_manager/view/PropertyView.js @@ -159,11 +159,13 @@ define(['backbone', 'text!./../templates/propertyLabel.html', 'text!./../templat // Check if component is allowed to be styled var hideNoStyle = this.config.hideNotStylable; if (!this.isTargetStylable() || !this.isComponentStylable()) { + console.log('not stylable ', this.property); if (hideNoStyle) { this.hide(); } return; } else { + console.log('stylable ', this.property); this.show(); } @@ -240,10 +242,10 @@ define(['backbone', 'text!./../templates/propertyLabel.html', 'text!./../templat } var stylable = component.get('stylable'); - console.log('ST', stylable); // Stylable could also be an array indicating with which property // the target could be styled if(stylable instanceof Array){ + console.log(this.property, stylable, _.indexOf(stylable, this.property)); stylable = _.indexOf(stylable, this.property) >= 0; }