FIX: edit category modal throws EmberError when allowed tag groups is set

This commit is contained in:
Neil Lalonde 2017-01-26 15:32:15 -05:00
parent 60f30aa6ad
commit 6e47e02738

View File

@ -8,12 +8,14 @@ export default Ember.TextField.extend({
_initValue: function() {
const names = this.get('tagGroups') || [];
this.set('value', names.join(", "));
this.set('value', names.join(","));
}.on('init'),
_valueChanged: function() {
const names = this.get('value').split(',').map(v => v.trim()).reject(v => v.length === 0).uniq();
this.set('tagGroups', names);
if ( this.get('tagGroups').join(',') !== this.get('value') ) {
this.set('tagGroups', names);
}
}.observes('value'),
_tagGroupsChanged: function() {