mirror of
https://github.com/Break27/kvmd.git
synced 2026-02-06 18:36:37 +08:00
web: force_desktop and force_mobile options
This commit is contained in:
parent
895ec1cb73
commit
dab9924096
@ -130,16 +130,18 @@ export function checkBrowser(desktop_css, mobile_css) {
|
||||
return false;
|
||||
|
||||
} else {
|
||||
if (browser.is_mobile) {
|
||||
__addCssLink("/share/css/x-mobile.css");
|
||||
if (mobile_css) {
|
||||
__addCssLink(mobile_css);
|
||||
}
|
||||
} else {
|
||||
let force_desktop = (new URL(window.location.href)).searchParams.get("force_desktop");
|
||||
let force_mobile = (new URL(window.location.href)).searchParams.get("force_mobile");
|
||||
if ((force_desktop || !browser.is_mobile) && !force_mobile) {
|
||||
__addCssLink("/share/css/x-desktop.css");
|
||||
if (desktop_css) {
|
||||
__addCssLink(desktop_css);
|
||||
}
|
||||
} else {
|
||||
__addCssLink("/share/css/x-mobile.css");
|
||||
if (mobile_css) {
|
||||
__addCssLink(mobile_css);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user