Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
claviska committed Dec 17, 2018
2 parents deadf3d + a6e5b49 commit 6bce29c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions jquery.minicolors.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
var size;
var swatches;
var swatch;
var swatchString;
var panel;
var i;

Expand Down Expand Up @@ -223,10 +224,11 @@
name = '';
swatch = settings.swatches[i];
}
swatchString = swatch;
swatch = isRgb(swatch) ? parseRgb(swatch, true) : hex2rgb(parseHex(swatch, true));
$('<li class="minicolors-swatch minicolors-sprite"><span class="minicolors-swatch-color" title="' + name + '"></span></li>')
.appendTo(swatches)
.data('swatch-color', settings.swatches[i])
.data('swatch-color', swatchString)
.find('.minicolors-swatch-color')
.css({
backgroundColor: rgb2hex(swatch),
Expand Down Expand Up @@ -283,7 +285,7 @@
if (settings.show) settings.show.call(input.get(0));
});
} else {
panel.css('opacity', 1);
panel.show();
if (settings.show) settings.show.call(input.get(0));
}
}
Expand All @@ -302,7 +304,7 @@
minicolors.removeClass('minicolors-focus');
});
} else {
panel.css('opacity', 0);
panel.hide();
if (settings.hide) settings.hide.call(input.get(0));
minicolors.removeClass('minicolors-focus');
}
Expand Down

0 comments on commit 6bce29c

Please sign in to comment.