♻️ 移动端面包屑消失

This commit is contained in:
Vanessa 2022-08-01 10:20:35 +08:00
parent a2e4f504a5
commit 2b9d5f0763
2 changed files with 8 additions and 7 deletions

View file

@ -65,12 +65,8 @@ class App {
if (navigator.userAgent.indexOf("iPhone") > -1) {
document.addEventListener("touchstart", handleTouchStart, false);
document.addEventListener("touchmove", handleTouchMove, false);
document.addEventListener("touchend", handleTouchEnd, false);
} else {
document.addEventListener("touchend", () => {
window.siyuan.mobileEditor?.protyle.breadcrumb.show();
}, false);
}
document.addEventListener("touchend", handleTouchEnd, false);
});
setNoteBook();
promiseTransactions();

View file

@ -9,8 +9,13 @@ const forwardStack: IBackStack[] = [];
let previousIsBack = false;
export const handleTouchEnd = () => {
window.siyuan.mobileEditor?.protyle.breadcrumb.show();
if (!clientX || !clientY) return;
if (window.siyuan.mobileEditor) {
window.siyuan.mobileEditor.protyle.breadcrumb.show();
}
if (!clientX || !clientY || navigator.userAgent.indexOf("iPhone") === -1) {
return;
}
if (Math.abs(xDiff) > Math.abs(yDiff) && Math.abs(xDiff) > window.innerWidth / 2) {
if (xDiff > 0) {