1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-18 04:21:12 +02:00

utils: add polyfill for requestIdlecallback

This commit is contained in:
Kushagra Gour
2018-02-15 02:58:27 +05:30
parent eab84297c1
commit ba4f11f60d

View File

@@ -20,6 +20,13 @@
return siblings[index + 1];
};
// Safari doesn't have this!
window.requestIdleCallback =
window.requestIdleCallback ||
function(fn) {
setTimeout(fn, 10);
};
/*
* @param Selector that should match for next siblings
* @return element Next element that mathes `selector`