From 521940f6040698ad0498ce5d27b65645842dca78 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 26 Aug 2019 15:30:35 +0200 Subject: [PATCH] Don't update the proxy onfinechange when picking a cursor color --- www/settings/inner.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/www/settings/inner.js b/www/settings/inner.js index c084e9dcd..f92df0221 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -1188,16 +1188,24 @@ define([ var $spinner = $('', {'class': 'fa fa-spinner fa-pulse'}); // when jscolor picker value change - var onchange = function (colorL) { + var _onchange = function (colorL) { var val = "#" + colorL.toString(); if (!/^#[0-9a-fA-F]{6}$/.test(val)) { return; } - $spinner.show(); - $ok.hide(); common.setAttribute(['general', 'cursor', 'color'], val, function () { $spinner.hide(); $ok.show(); }); }; + var to; + var onchange = function (colorL) { + $spinner.show(); + $ok.hide(); + + if (to) { clearTimeout(to); } + to = setTimeout(function () { + _onchange(colorL); + }, 300); + }; // jscolor picker var jscolorL = new window.jscolor($colorPicker[0],{showOnClick: false, onFineChange: onchange, valueElement:undefined});