don't reinsert reinterpreted color on start
do it only on the Enter key or once the user explicitly changed the color at least once
This commit is contained in:
parent
e0ea76a940
commit
0ed6e3d4bf
|
@ -330,8 +330,8 @@ CodeMirror.defineExtension('colorpicker', function () {
|
||||||
setFromInputs();
|
setFromInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
function setFromInputs() {
|
function setFromInputs(event) {
|
||||||
userActivity = performance.now();
|
userActivity = event ? performance.now() : userActivity;
|
||||||
if ($inputs[currentFormat].every(validateInput)) {
|
if ($inputs[currentFormat].every(validateInput)) {
|
||||||
setFromColor($inputs.color);
|
setFromColor($inputs.color);
|
||||||
}
|
}
|
||||||
|
@ -598,7 +598,7 @@ CodeMirror.defineExtension('colorpicker', function () {
|
||||||
if (!e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
|
if (!e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
|
||||||
switch (e.which) {
|
switch (e.which) {
|
||||||
case 13:
|
case 13:
|
||||||
setFromInputs();
|
setFromInputs({});
|
||||||
colorpickerCallback();
|
colorpickerCallback();
|
||||||
// fallthrough to 27
|
// fallthrough to 27
|
||||||
case 27:
|
case 27:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user