2
0
mirror of https://github.com/PitPik/tinyColorPicker synced 2025-07-17 06:54:28 -06:00

Fix initial color and background color options

This commit is contained in:
M Saiqul Haq 2016-07-03 12:04:07 +07:00
parent 81321faa74
commit 41460490a8
4 changed files with 8 additions and 6 deletions

View File

@ -31,7 +31,7 @@
Colors = function(options) {
this.colors = {RND: {}};
this.options = {
color: 'rgba(0,0,0,0)', // init value(s)...
color: options.color || 'rgba(0,0,0,0)', // init value(s)...
grey: grey,
luminance: luminance,
valueRanges: _valueRanges

View File

@ -272,7 +272,7 @@
animationSpeed: 150,
GPU: true,
doRender: true,
customBG: '#FFF',
customBG: $(this).css('background-color') || '#FFF',
opacity: true,
renderCallback: noop,
buildCallback: noop,
@ -304,6 +304,8 @@
.add(_instance.filter(e.target))[0] && toggle();
});
var customBG = options.customBG;
return this.on('focusin.tcp click.tcp', function(event) {
_colorPicker.color.options = // swap options to fake new instance
$.extend(_colorPicker.color.options, _options = _this.options);
@ -314,7 +316,7 @@
_this.colorPicker.render(true);
})
.each(function() {
var value = extractValue(this),
var value = customBG || extractValue(this),
mode = value.split('('),
$elm = findElement($(this));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long