diff --git a/app/src/mobile/index.ts b/app/src/mobile/index.ts index 4831d0fe3..6ac3edeae 100644 --- a/app/src/mobile/index.ts +++ b/app/src/mobile/index.ts @@ -19,6 +19,7 @@ import {hideKeyboardToolbar, showKeyboardToolbar} from "./util/keyboardToolbar"; import {getLocalStorage} from "../protyle/util/compatibility"; import {openMobileFileById} from "./editor"; import {getSearch} from "../util/functions"; +import {initRightMenu} from "./menu"; class App { constructor() { @@ -63,15 +64,14 @@ class App { fetchPost("/api/system/getEmojiConf", {}, emojiResponse => { window.siyuan.emojis = emojiResponse.data as IEmoji[]; initFramework(); + initRightMenu(); }); }); addGA(); }); }); - if (navigator.userAgent.indexOf("iPhone") > -1) { - document.addEventListener("touchstart", handleTouchStart, false); - document.addEventListener("touchmove", handleTouchMove, false); - } + document.addEventListener("touchstart", handleTouchStart, false); + document.addEventListener("touchmove", handleTouchMove, false); document.addEventListener("touchend", handleTouchEnd, false); }); setNoteBook(); diff --git a/app/src/mobile/menu/index.ts b/app/src/mobile/menu/index.ts index 491327961..f5c17ec2b 100644 --- a/app/src/mobile/menu/index.ts +++ b/app/src/mobile/menu/index.ts @@ -18,11 +18,11 @@ import {getRecentDocs} from "./getRecentDocs"; export const popMenu = () => { activeBlur(); hideKeyboardToolbar(); + document.getElementById("menu").style.right = "0"; +}; + +export const initRightMenu = () => { const menuElement = document.getElementById("menu"); - if (menuElement.innerHTML !== "") { - menuElement.style.right = "0"; - return; - } let accountHTML = ""; if (window.siyuan.user && !window.siyuan.config.readonly) { accountHTML = `