mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
feat(app): hardware back button support
This commit is contained in:
@ -9,6 +9,14 @@ export function reorderArray(array: any[], indexes: {from: number, to: number}):
|
||||
return array;
|
||||
}
|
||||
|
||||
export function rIC(callback: () => void) {
|
||||
if ('requestIdleCallback' in window) {
|
||||
(window as any).requestIdleCallback(callback);
|
||||
} else {
|
||||
setTimeout(callback, 32);
|
||||
}
|
||||
}
|
||||
|
||||
export function hasShadowDom(el: HTMLElement) {
|
||||
return !!el.shadowRoot && !!(el as any).attachShadow;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user