mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-17 01:21:14 +08:00
This commit is contained in:
parent
79a265812d
commit
ada1b351fd
@ -36,7 +36,12 @@ export const handleTouchEnd = (event: TouchEvent, app: App) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const target = event.target as HTMLElement;
|
const target = event.target as HTMLElement;
|
||||||
if (!clientX || !clientY || typeof yDiff === "undefined" ||
|
if (!clientX) {
|
||||||
|
// 上下滚动时防止左右滚动会将 clientX 清空
|
||||||
|
closePanel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!clientY || typeof yDiff === "undefined" ||
|
||||||
target.tagName === "AUDIO" ||
|
target.tagName === "AUDIO" ||
|
||||||
hasClosestByClassName(target, "b3-dialog", true) ||
|
hasClosestByClassName(target, "b3-dialog", true) ||
|
||||||
(window.siyuan.mobile.editor && !window.siyuan.mobile.editor.protyle.toolbar.subElement.classList.contains("fn__none")) ||
|
(window.siyuan.mobile.editor && !window.siyuan.mobile.editor.protyle.toolbar.subElement.classList.contains("fn__none")) ||
|
||||||
@ -44,7 +49,6 @@ export const handleTouchEnd = (event: TouchEvent, app: App) => {
|
|||||||
hasClosestByClassName(target, "keyboard") ||
|
hasClosestByClassName(target, "keyboard") ||
|
||||||
hasClosestByAttribute(target, "id", "commonMenu")
|
hasClosestByAttribute(target, "id", "commonMenu")
|
||||||
) {
|
) {
|
||||||
closePanel();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (window.siyuan.mobile.editor) {
|
if (window.siyuan.mobile.editor) {
|
||||||
@ -181,9 +185,9 @@ export const handleTouchMove = (event: TouchEvent) => {
|
|||||||
|
|
||||||
xDiff = Math.floor(clientX - event.touches[0].clientX);
|
xDiff = Math.floor(clientX - event.touches[0].clientX);
|
||||||
yDiff = Math.floor(clientY - event.touches[0].clientY);
|
yDiff = Math.floor(clientY - event.touches[0].clientY);
|
||||||
|
// 上下滚动防止左右滑动
|
||||||
if (Math.abs(xDiff) < Math.abs(yDiff)) {
|
if (Math.abs(xDiff) < Math.abs(yDiff)) {
|
||||||
clientX = null;
|
clientX = null;
|
||||||
clientY = null;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!firstDirection) {
|
if (!firstDirection) {
|
||||||
|
Loading…
Reference in New Issue
Block a user