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:
parent
81321faa74
commit
41460490a8
@ -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
|
||||
|
@ -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
4
jqColorPicker.min.js
vendored
4
jqColorPicker.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user