From 0ed6e3d4bfa77151b2b1184d814d8a338d507fd3 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 22 Nov 2017 15:20:10 +0300 Subject: [PATCH] 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 --- vendor-overwrites/colorpicker/colorpicker.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vendor-overwrites/colorpicker/colorpicker.js b/vendor-overwrites/colorpicker/colorpicker.js index 834cd313..3e8ab026 100644 --- a/vendor-overwrites/colorpicker/colorpicker.js +++ b/vendor-overwrites/colorpicker/colorpicker.js @@ -330,8 +330,8 @@ CodeMirror.defineExtension('colorpicker', function () { setFromInputs(); } - function setFromInputs() { - userActivity = performance.now(); + function setFromInputs(event) { + userActivity = event ? performance.now() : userActivity; if ($inputs[currentFormat].every(validateInput)) { setFromColor($inputs.color); } @@ -598,7 +598,7 @@ CodeMirror.defineExtension('colorpicker', function () { if (!e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) { switch (e.which) { case 13: - setFromInputs(); + setFromInputs({}); colorpickerCallback(); // fallthrough to 27 case 27: