This commit is contained in:
Vanessa
2026-05-04 13:30:55 +08:00
parent 76e7ecb19c
commit cb7f6f7cb8
3 changed files with 2 additions and 21 deletions
+1 -3
View File
@@ -6,7 +6,7 @@ import {globalClick} from "./click";
import {goBack, goForward} from "../../util/backForward";
import {Constants} from "../../constants";
import {isIPad} from "../../protyle/util/compatibility";
import {globalTouchEnd, globalTouchStart} from "./touch";
import {globalTouchEnd} from "./touch";
import {initDockMenu} from "../../menus/dock";
import {hasClosestByAttribute, hasClosestByClassName, isInEmbedBlock} from "../../protyle/util/hasClosest";
import {initTabMenu} from "../../menus/tab";
@@ -147,8 +147,6 @@ export const initWindowEvent = (app: App) => {
embedBlockElement.firstElementChild.classList.toggle("protyle-icons--show");
return;
}
// 触摸屏背景和嵌入块按钮显示
globalTouchStart(event);
}, false);
document.addEventListener("touchend", (event) => {
-13
View File
@@ -17,19 +17,6 @@ import {Tab} from "../../layout/Tab";
import {Editor} from "../../editor";
import {hideTooltip} from "../../dialog/tooltip";
export const globalTouchStart = (event: TouchEvent) => {
const target = event.target as HTMLElement;
const backgroundElement = hasClosestByClassName(target, "protyle-background");
if (backgroundElement) {
if (backgroundElement.classList.contains("protyle-background--enable")) {
backgroundElement.classList.add("protyle-background--mobileshow");
}
} else {
document.querySelector(".protyle-background--mobileshow")?.classList.remove("protyle-background--mobileshow");
}
return false;
};
export const globalTouchEnd = (event: TouchEvent, yDiff: number, time: number, app: App) => {
const target = event.target as HTMLElement;
const isIPadBoolean = isIPad();
+1 -5
View File
@@ -9,7 +9,7 @@ import {popMenu} from "../menu";
import {activeBlur} from "./keyboardToolbar";
import {isIPhone} from "../../protyle/util/compatibility";
import {App} from "../../index";
import {globalTouchEnd, globalTouchStart} from "../../boot/globalEvent/touch";
import {globalTouchEnd} from "../../boot/globalEvent/touch";
import {getRangeByPoint} from "../../protyle/util/selection";
import {getCurrentEditor} from "../editor";
@@ -163,10 +163,6 @@ export const handleTouchStart = (event: TouchEvent) => {
return;
}
if (globalTouchStart(event)) {
return;
}
if (getSelection().rangeCount > 0 && hasClosestBlock(event.target as Element)) {
const editor = getCurrentEditor();
if (editor && !editor.protyle.disabled && event.touches[0].clientY > window.innerHeight / 2 &&