diff --git a/jquery.simplecolorpicker.css b/jquery.simplecolorpicker.css index 001a5ae..6b59051 100644 --- a/jquery.simplecolorpicker.css +++ b/jquery.simplecolorpicker.css @@ -85,3 +85,13 @@ .simplecolorpicker span.vr { border-left: 1px solid #222; /* @gray-dark */ } + +.simplecolorpicker input[type="color"] { + width: 0; + height: 0; + padding: 0; + border: 0; + visibility: hidden; +} + +.simplecolorpicker .custom-container { text-align: right; } \ No newline at end of file diff --git a/jquery.simplecolorpicker.js b/jquery.simplecolorpicker.js index ac63238..249aaab 100644 --- a/jquery.simplecolorpicker.js +++ b/jquery.simplecolorpicker.js @@ -93,8 +93,11 @@ + role + '>' + ''); - self.$colorList.append($colorSpan); - $colorSpan.on('click.' + self.type, $.proxy(self.colorSpanClicked, self)); + if($option.data('is-user-defined') == undefined) { + self.$colorList.append($colorSpan); + $colorSpan.on('click.' + self.type, $.proxy(self.colorSpanClicked, self)); + } else + self.setupCustomColorSelector($colorSpan); var $next = $option.next(); if ($next.is('optgroup') === true) { @@ -173,6 +176,29 @@ } }, + setupCustomColorSelector: function(colorSpan) { + var customColorContainer = $('