Skip to content
This repository was archived by the owner on Aug 9, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions jquery.simplecolorpicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@
}

// Build the list of colors
// <span class="color selected" title="Green" style="background-color: #7bd148;" role="button"></span>
// Color HEX code is added to CSS Classes with # removed and 'cp-' prepended
// <span class="color cp-ffffff selected" title="Green" style="background-color: #7bd148;" role="button"></span>
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');
Expand All @@ -84,7 +86,7 @@
role = ' role="button" tabindex="0"';
}

var $colorSpan = $('<span class="color"'
var $colorSpan = $('<span class="color ' + colorCssClass + '"'
+ title
+ ' style="background-color: ' + color + ';"'
+ ' data-color="' + color + '"'
Expand Down