Skip to content

Commit 9a161fc

Browse files
committedMay 4, 2022
v.2.2.2
* update coloselector/input when setting color through setColor method
1 parent e7207f1 commit 9a161fc

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed
 

‎colorpicker.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* ColorPicker
33
* https://github.com/foo123/ColorPicker
4-
* @version 2.2.1
4+
* @version 2.2.2
55
*
66
* adapted from:
77
* http://www.eyecon.ro/colorpicker/
@@ -798,7 +798,10 @@ function ColorPicker(el, options)
798798
};
799799
self.setColor = function(color, opacity) {
800800
if (set_color(model, color, opacity))
801+
{
801802
update_ui(model, fields, true);
803+
update_element(self, colorselector, input, get_color(model, format), false);
804+
}
802805
};
803806
self.getColor = function(fmt) {
804807
return get_color(model, fmt || format);
@@ -807,7 +810,10 @@ function ColorPicker(el, options)
807810
if (arguments.length)
808811
{
809812
if (set_color(model, color, opacity))
813+
{
810814
update_ui(model, fields, true);
815+
update_element(self, colorselector, input, get_color(model, format), false);
816+
}
811817
}
812818
else
813819
{
@@ -920,7 +926,7 @@ function ColorPicker(el, options)
920926
if (hasClass(el,'colorpicker-transition-fade')) addClass(ui,'colorpicker-transition-fade');
921927
if (hasClass(el,'colorpicker-transition-slide')) addClass(ui,'colorpicker-transition-slide');
922928
}
923-
ColorPicker.VERSION = '2.2.1';
929+
ColorPicker.VERSION = '2.2.2';
924930
ColorPicker.WIDTH = 343;
925931
ColorPicker.HEIGHT = 195;
926932
return ColorPicker;

0 commit comments

Comments
 (0)