From 6d28c39ae845cb0ac6e35562aaa52d8219b95bc8 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sun, 12 Feb 2023 17:20:09 +0330 Subject: en lang edit, new designed --- web/assets/js/util/common.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'web/assets/js/util/common.js') diff --git a/web/assets/js/util/common.js b/web/assets/js/util/common.js index 7225e4ba..b3ebc0bd 100644 --- a/web/assets/js/util/common.js +++ b/web/assets/js/util/common.js @@ -54,4 +54,16 @@ function addZero(num) { function toFixed(num, n) { n = Math.pow(10, n); return Math.round(num * n) / n; -} \ No newline at end of file +} + +function debounce (fn, delay) { + var timeoutID = null + return function () { + clearTimeout(timeoutID) + var args = arguments + var that = this + timeoutID = setTimeout(function () { + fn.apply(that, args) + }, delay) + } + } \ No newline at end of file -- cgit v1.2.3