From 2ba4c4f11b9147c1364c2bf17e7ea2099180ffa9 Mon Sep 17 00:00:00 2001 From: eight Date: Thu, 14 Sep 2017 09:15:58 +0800 Subject: [PATCH] Fix: remove debounce dependency --- js/dom.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/dom.js b/js/dom.js index 81fde80b..003b02c7 100644 --- a/js/dom.js +++ b/js/dom.js @@ -33,7 +33,11 @@ for (const type of [NodeList, NamedNodeMap, HTMLCollection, HTMLAllCollection]) // enqueue after DOMContentLoaded/load events setTimeout(addTooltipsToEllipsized); // throttle on continuous resizing - window.addEventListener('resize', () => debounce(addTooltipsToEllipsized, 100)); + let timer; + window.addEventListener('resize', () => { + clearTimeout(timer); + timer = setTimeout(addTooltipsToEllipsized, 100); + }); } onDOMready().then(() => {