mirror of
https://github.com/PitPik/tinyColorPicker
synced 2025-07-17 23:14:29 -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) {
|
Colors = function(options) {
|
||||||
this.colors = {RND: {}};
|
this.colors = {RND: {}};
|
||||||
this.options = {
|
this.options = {
|
||||||
color: 'rgba(0,0,0,0)', // init value(s)...
|
color: options.color || 'rgba(0,0,0,0)', // init value(s)...
|
||||||
grey: grey,
|
grey: grey,
|
||||||
luminance: luminance,
|
luminance: luminance,
|
||||||
valueRanges: _valueRanges
|
valueRanges: _valueRanges
|
||||||
|
@ -272,7 +272,7 @@
|
|||||||
animationSpeed: 150,
|
animationSpeed: 150,
|
||||||
GPU: true,
|
GPU: true,
|
||||||
doRender: true,
|
doRender: true,
|
||||||
customBG: '#FFF',
|
customBG: $(this).css('background-color') || '#FFF',
|
||||||
opacity: true,
|
opacity: true,
|
||||||
renderCallback: noop,
|
renderCallback: noop,
|
||||||
buildCallback: noop,
|
buildCallback: noop,
|
||||||
@ -304,6 +304,8 @@
|
|||||||
.add(_instance.filter(e.target))[0] && toggle();
|
.add(_instance.filter(e.target))[0] && toggle();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var customBG = options.customBG;
|
||||||
|
|
||||||
return this.on('focusin.tcp click.tcp', function(event) {
|
return this.on('focusin.tcp click.tcp', function(event) {
|
||||||
_colorPicker.color.options = // swap options to fake new instance
|
_colorPicker.color.options = // swap options to fake new instance
|
||||||
$.extend(_colorPicker.color.options, _options = _this.options);
|
$.extend(_colorPicker.color.options, _options = _this.options);
|
||||||
@ -314,7 +316,7 @@
|
|||||||
_this.colorPicker.render(true);
|
_this.colorPicker.render(true);
|
||||||
})
|
})
|
||||||
.each(function() {
|
.each(function() {
|
||||||
var value = extractValue(this),
|
var value = customBG || extractValue(this),
|
||||||
mode = value.split('('),
|
mode = value.split('('),
|
||||||
$elm = findElement($(this));
|
$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