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});