From bb99279a42edfcddda94582217a271aaa234ff44 Mon Sep 17 00:00:00 2001 From: Jason Davis Date: Thu, 12 Mar 2015 22:10:53 -0400 Subject: [PATCH] Added Color HEX code with # removed and 'cp-' prepended as a CSS Class name to each color option. This allows you to easily target any color selection option with CSS. WHen I used the color White #ffffff you could not see the option with no border set. I can now target the color White with my CSS to add a border! --- jquery.simplecolorpicker.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jquery.simplecolorpicker.js b/jquery.simplecolorpicker.js index ac63238..5784743 100644 --- a/jquery.simplecolorpicker.js +++ b/jquery.simplecolorpicker.js @@ -56,10 +56,12 @@ } // Build the list of colors - // + // Color HEX code is added to CSS Classes with # removed and 'cp-' prepended + // self.$select.find('> option').each(function() { var $option = $(this); var color = $option.val(); + var colorCssClass = 'cp-' + color.substring(1); var isSelected = $option.is(':selected'); var isDisabled = $option.is(':disabled'); @@ -84,7 +86,7 @@ role = ' role="button" tabindex="0"'; } - var $colorSpan = $('