mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-17 05:33:59 -05:00
50d38d7605
* fix(dropdown_menu): Open as modal on mobile * fix(dropdown_menu): Open modal on touch * fix(dropdown_menu): Show status * fix(dropdown_menu): Max dimensions and reduce padding * chore(dropdown_menu): Test new functionality * refactor: Use DropdownMenuContainer instead of DropdownMenu * feat(privacy_dropdown): Open as modal on touch devices * feat(modal_root): Do not load actions-modal async
21 lines
407 B
JavaScript
21 lines
407 B
JavaScript
const LAYOUT_BREAKPOINT = 1024;
|
|
|
|
export function isMobile(width) {
|
|
return width <= LAYOUT_BREAKPOINT;
|
|
};
|
|
|
|
const iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
|
let userTouching = false;
|
|
|
|
window.addEventListener('touchstart', () => {
|
|
userTouching = true;
|
|
}, { once: true });
|
|
|
|
export function isUserTouching() {
|
|
return userTouching;
|
|
}
|
|
|
|
export function isIOS() {
|
|
return iOS;
|
|
};
|