diff options
author | Maxim Devaev <[email protected]> | 2023-08-09 03:45:26 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2023-08-09 03:45:26 +0300 |
commit | dab99240962beb2818b8f9f7a979f3e9c2c0e288 (patch) | |
tree | 253a52829aee64602c68027b1530b069f9cdca4d | |
parent | 895ec1cb737a655a9b8ccdc6b6a911a9bfdd8e74 (diff) |
web: force_desktop and force_mobile options
-rw-r--r-- | web/share/js/bb.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/web/share/js/bb.js b/web/share/js/bb.js index 3a54e8e7..4a58a5d4 100644 --- a/web/share/js/bb.js +++ b/web/share/js/bb.js @@ -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; } |