mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-07-21 23:26:12 +00:00
remove legacy prefixed RAF
This commit is contained in:
@ -156,14 +156,8 @@ export function template(str, data) {
|
|||||||
// mobile devices (by setting image `src` to this string).
|
// mobile devices (by setting image `src` to this string).
|
||||||
export const emptyImageUrl = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';
|
export const emptyImageUrl = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';
|
||||||
|
|
||||||
// inspired by https://paulirish.com/2011/requestanimationframe-for-smart-animating/
|
const requestFn = window.requestAnimationFrame;
|
||||||
|
const cancelFn = window.cancelAnimationFrame;
|
||||||
function getPrefixed(name) {
|
|
||||||
return window[`webkit${name}`] || window[`moz${name}`] || window[`ms${name}`];
|
|
||||||
}
|
|
||||||
|
|
||||||
export const requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame');
|
|
||||||
export const cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') || getPrefixed('CancelRequestAnimationFrame');
|
|
||||||
|
|
||||||
// @function requestAnimFrame(fn: Function, context?: Object): Number
|
// @function requestAnimFrame(fn: Function, context?: Object): Number
|
||||||
// Schedules `fn` to be executed when the browser repaints. `fn` is bound to `context` if given.
|
// Schedules `fn` to be executed when the browser repaints. `fn` is bound to `context` if given.
|
||||||
|
Reference in New Issue
Block a user