fix: fullscreen improvements for iOS & iPadOS
This commit is contained in:
@ -3,12 +3,19 @@
|
||||
// Unfortunately, due to mixed support, UA sniffing is required
|
||||
// ==========================================================================
|
||||
|
||||
const browser = {
|
||||
isIE: Boolean(window.document.documentMode),
|
||||
isEdge: /Edge/g.test(navigator.userAgent),
|
||||
isWebkit: 'WebkitAppearance' in document.documentElement.style && !/Edge/g.test(navigator.userAgent),
|
||||
isIPhone: /iPhone|iPod/gi.test(navigator.userAgent) && navigator.maxTouchPoints > 1,
|
||||
isIos: /iPad|iPhone|iPod/gi.test(navigator.userAgent) && navigator.maxTouchPoints > 1,
|
||||
};
|
||||
const isIE = Boolean(window.document.documentMode);
|
||||
const isEdge = /Edge/g.test(navigator.userAgent);
|
||||
const isWebKit = 'WebkitAppearance' in document.documentElement.style && !/Edge/g.test(navigator.userAgent);
|
||||
const isIPhone = /iPhone|iPod/gi.test(navigator.userAgent) && navigator.maxTouchPoints > 1;
|
||||
// navigator.platform may be deprecated but this check is still required
|
||||
const isIPadOS = navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1;
|
||||
const isIos = /iPad|iPhone|iPod/gi.test(navigator.userAgent) && navigator.maxTouchPoints > 1;
|
||||
|
||||
export default browser;
|
||||
export default {
|
||||
isIE,
|
||||
isEdge,
|
||||
isWebKit,
|
||||
isIPhone,
|
||||
isIPadOS,
|
||||
isIos,
|
||||
};
|
||||
|
@ -67,7 +67,7 @@ export function createElement(type, attributes, text) {
|
||||
return element;
|
||||
}
|
||||
|
||||
// Inaert an element after another
|
||||
// Insert an element after another
|
||||
export function insertAfter(element, target) {
|
||||
if (!is.element(element) || !is.element(target)) {
|
||||
return;
|
||||
|
@ -13,7 +13,7 @@ export function generateId(prefix) {
|
||||
export function format(input, ...args) {
|
||||
if (is.empty(input)) return input;
|
||||
|
||||
return input.toString().replace(/{(\d+)}/g, (match, i) => args[i].toString());
|
||||
return input.toString().replace(/{(\d+)}/g, (_, i) => args[i].toString());
|
||||
}
|
||||
|
||||
// Get percentage
|
||||
|
Reference in New Issue
Block a user