mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-21 07:46:09 +01:00
This commit is contained in:
parent
02b62eba65
commit
953920e4de
3 changed files with 34 additions and 6 deletions
|
|
@ -2,6 +2,25 @@ export const isMobile = () => {
|
|||
return document.getElementById("sidebar") ? true : false;
|
||||
};
|
||||
|
||||
export const getFrontend = () => {
|
||||
/// #if MOBILE
|
||||
if (window.navigator.userAgent.startsWith("SiYuan/")) {
|
||||
return "mobile";
|
||||
} else {
|
||||
return "browser-mobile";
|
||||
}
|
||||
/// #else
|
||||
if (window.navigator.userAgent.startsWith("SiYuan/")) {
|
||||
if (isWindow()) {
|
||||
return "desktop-window";
|
||||
}
|
||||
return "desktop";
|
||||
} else {
|
||||
return "browser-desktop";
|
||||
}
|
||||
/// #endif
|
||||
};
|
||||
|
||||
export const isWindow = () => {
|
||||
return document.getElementById("toolbar") ? false : true;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue