diff options
| author | MHSanaei <mc.sanaei@gmail.com> | 2023-02-12 16:50:09 +0300 |
|---|---|---|
| committer | MHSanaei <mc.sanaei@gmail.com> | 2023-02-12 16:50:09 +0300 |
| commit | 6d28c39ae845cb0ac6e35562aaa52d8219b95bc8 (patch) | |
| tree | bb80e5bffe67919a772694196dc80e1a99b47077 /web/assets/js/util | |
| parent | 920259b6f8345f30c6a4bd40205c18a37b867f0f (diff) | |
en lang edit, new designed
Diffstat (limited to 'web/assets/js/util')
| -rw-r--r-- | web/assets/js/util/common.js | 14 |
1 files changed, 13 insertions, 1 deletions
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 |
