The problem line:
@computed("setting.preview", "buffered.value")
preview(preview, value) {
if (preview) {
return new Handlebars.SafeString("<div class='preview'>" + preview.replace(/\{\{value\}\}/g, value) + "</div>");
}
},
@computed('componentType')
typeClass(componentType) {
return componentType.replace("_", "-");
},
@computed("setting.setting")
settingName(setting) {
return setting.replace(/\_/g, ' ');
},
@computed("setting.type")
componentType(type) {
return CustomTypes.indexOf(type) !== -1 ? type : 'string';
Surely, it must be:
return componentType.replace(/_/g, '-');
For now, typeClass()
incorrectly handles multiword setting types, for example: my_setting_type
=> my-setting_type
because JavaScript String.replace()
method replaces only the first occurence by default.
4 Likes
zogstrip
(Régis Hanol)
August 27, 2015, 8:49am
2
3 Likes