mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-10 12:03:08 +02:00
This commit is contained in:
parent
788edd3622
commit
22c4842154
1 changed files with 8 additions and 3 deletions
|
@ -84,9 +84,14 @@
|
||||||
|
|
||||||
// Detect the user agent
|
// Detect the user agent
|
||||||
const ua = navigator.userAgent.toLowerCase();
|
const ua = navigator.userAgent.toLowerCase();
|
||||||
const isMobile = settings.device.appTypeForce === 'mobile' ||
|
let isMobile = /mobile|iphone|ipad|android/.test(ua) || window.innerWidth < 576
|
||||||
(settings.device.appTypeForce !== 'desktop'
|
if (settings && settings.device.appTypeForce) {
|
||||||
&& (/mobile|iphone|ipad|android/.test(ua) || window.innerWidth < 576));
|
if (settings.device.appTypeForce === 'mobile') {
|
||||||
|
isMobile = true
|
||||||
|
} else if (settings.device.appTypeForce === 'desktop') {
|
||||||
|
isMobile = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get the <head> element
|
// Get the <head> element
|
||||||
const head = document.getElementsByTagName('head')[0];
|
const head = document.getElementsByTagName('head')[0];
|
||||||
|
|
Loading…
Reference in a new issue