Fix: remove debounce dependency

This commit is contained in:
eight 2017-09-14 09:15:58 +08:00
parent 37c83ce187
commit 2ba4c4f11b

View File

@ -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(() => {