Prevent user from selecting the same category twice for different notification levels in their preferences

This commit is contained in:
Benjamin Kampmann
2014-04-09 16:32:58 +02:00
parent 6daef624c3
commit 72a6566bfd
3 changed files with 9 additions and 4 deletions
@@ -11,7 +11,8 @@ Discourse.CategoryGroupComponent = Ember.Component.extend({
return Discourse.Category.list().filter(function(category){
var regex = new RegExp(term, "i");
return category.get("name").match(regex) &&
!_.contains(self.get('categories'), category);
!_.contains(self.get('blacklist') || [], category) &&
!_.contains(self.get('categories'), category) ;
});
},
onChangeItems: function(items) {