jshint made me break my code. Change logic to fix usedBackgroundColors and make jshint happy

This commit is contained in:
Neil Lalonde 2013-04-08 19:18:24 -04:00
parent 93f36cdf93
commit 64eeb7f21e

View file

@ -32,7 +32,7 @@ Discourse.EditCategoryView = Discourse.ModalBodyView.extend({
usedBackgroundColors: function() {
return Discourse.site.categories.map(function(c) {
// If editing a category, don't include its color:
return (!this.get('category.id') || this.get('category.color').toUpperCase() !== c.color.toUpperCase()) ? c.color.toUpperCase() : null;
return (this.get('category.id') && this.get('category.color').toUpperCase() === c.color.toUpperCase()) ? null : c.color.toUpperCase();
}, this).compact();
}.property('Discourse.site.categories', 'category.id', 'category.color'),