From 64eeb7f21e12cdc741ec2d304f19df1a5f7d5da0 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Mon, 8 Apr 2013 19:18:24 -0400 Subject: [PATCH] jshint made me break my code. Change logic to fix usedBackgroundColors and make jshint happy --- .../javascripts/discourse/views/modal/edit_category_view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/views/modal/edit_category_view.js b/app/assets/javascripts/discourse/views/modal/edit_category_view.js index 4991464b8..73c5a0fb4 100644 --- a/app/assets/javascripts/discourse/views/modal/edit_category_view.js +++ b/app/assets/javascripts/discourse/views/modal/edit_category_view.js @@ -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'),