Skip to content
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
13 changes: 13 additions & 0 deletions spectrum.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,19 @@
isEmpty = !initialColor,
allowEmpty = opts.allowEmpty && !isInputTypeColor;

//If there is a label for this element, when clicked on, show the colour picker
var thisId = boundElement.attr('id');
if(thisId !== undefined && thisId.length > 0) {
var label = $('label[for="'+thisId+'"]');
if(label.length) {
label.on('click', function(e){
e.preventDefault();
boundElement.spectrum('show');
return false;
});
}
}

function applyOptions() {

if (opts.showPaletteOnly) {
Expand Down