mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-18 20:41:13 +02:00
utils: add polyfill for requestIdlecallback
This commit is contained in:
@@ -20,6 +20,13 @@
|
|||||||
return siblings[index + 1];
|
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
|
* @param Selector that should match for next siblings
|
||||||
* @return element Next element that mathes `selector`
|
* @return element Next element that mathes `selector`
|
||||||
|
Reference in New Issue
Block a user