mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-17 20:11:12 +02:00
utils: add polyfill for requestIdlecallback
This commit is contained in:
@@ -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`
|
||||
|
Reference in New Issue
Block a user