From 78d9b441066d5b9948121eb7e82f43279b8b57f5 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 9 Apr 2013 12:52:06 -0400 Subject: [PATCH] Show custom colours in colour picker too --- .../javascripts/discourse/views/modal/edit_category_view.js | 3 ++- app/assets/stylesheets/application/colorpicker.css.scss | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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 73c5a0fb4f3..43312e7dccb 100644 --- a/app/assets/javascripts/discourse/views/modal/edit_category_view.js +++ b/app/assets/javascripts/discourse/views/modal/edit_category_view.js @@ -26,7 +26,8 @@ Discourse.EditCategoryView = Discourse.ModalBodyView.extend({ // background colors are available as a pipe-separated string backgroundColors: function() { - return Discourse.SiteSettings.category_colors.split("|").map(function(i) { return i.toUpperCase(); }); + return Discourse.SiteSettings.category_colors.split("|").map(function(i) { return i.toUpperCase(); }).concat( + Discourse.site.categories.map(function(c) { return c.color.toUpperCase(); }) ).uniq(); }.property('Discourse.SiteSettings.category_colors'), usedBackgroundColors: function() { diff --git a/app/assets/stylesheets/application/colorpicker.css.scss b/app/assets/stylesheets/application/colorpicker.css.scss index 69d7ba7ff51..b21c443f80a 100644 --- a/app/assets/stylesheets/application/colorpicker.css.scss +++ b/app/assets/stylesheets/application/colorpicker.css.scss @@ -15,9 +15,10 @@ .colors-container { display: inline-block; - vertical-align: bottom; - padding-bottom: 2px; + vertical-align: middle; + padding-top: 4px; padding-left: 15px; + max-width: 320px; .colorpicker { border: 1px solid $darkish_gray;