mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(hydrate): avoid window reference (#18865)
This commit is contained in:
@ -1,8 +1,16 @@
|
|||||||
import { HTMLStencilElement } from '../types/interfaces';
|
import { HTMLStencilElement } from '../types/interfaces';
|
||||||
|
|
||||||
|
declare const __zone_symbol__requestAnimationFrame: any;
|
||||||
|
declare const requestAnimationFrame: any;
|
||||||
|
|
||||||
export const raf = (h: any) => {
|
export const raf = (h: any) => {
|
||||||
const win = window as any;
|
if (typeof __zone_symbol__requestAnimationFrame === 'function') {
|
||||||
return (win.__zone_symbol__requestAnimationFrame) ? win.__zone_symbol__requestAnimationFrame(h) : requestAnimationFrame(h);
|
return __zone_symbol__requestAnimationFrame(h);
|
||||||
|
}
|
||||||
|
if (typeof requestAnimationFrame === 'function') {
|
||||||
|
return requestAnimationFrame(h);
|
||||||
|
}
|
||||||
|
return setTimeout(h);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const proxyMethod = (ctrlName: string, doc: Document, methodName: string, ...args: any[]) => {
|
export const proxyMethod = (ctrlName: string, doc: Document, methodName: string, ...args: any[]) => {
|
||||||
|
Reference in New Issue
Block a user