From 240b6054fd82ae992d9e8359bd1c26fc98a11ef5 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 15 Jul 2020 13:00:52 -0400 Subject: [PATCH] implement a 'clear' method for throttled functions --- www/common/common-util.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/www/common/common-util.js b/www/common/common-util.js index 424dbfdd3..95959d733 100644 --- a/www/common/common-util.js +++ b/www/common/common-util.js @@ -310,6 +310,10 @@ clearTimeout(to); to = setTimeout(Util.bake(f, Util.slice(arguments)), ms); }; + g.clear = function () { + clearTimeout(to); + to = undefined; + }; return g; };