From cb7f6f7cb8b9409fe6573e95d5d25f493cbcf8cf Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 4 May 2026 13:30:55 +0800 Subject: [PATCH] :recycle: --- app/src/boot/globalEvent/event.ts | 4 +--- app/src/boot/globalEvent/touch.ts | 13 ------------- app/src/mobile/util/touch.ts | 6 +----- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/app/src/boot/globalEvent/event.ts b/app/src/boot/globalEvent/event.ts index 637cd6fdd..47a5b442f 100644 --- a/app/src/boot/globalEvent/event.ts +++ b/app/src/boot/globalEvent/event.ts @@ -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) => { diff --git a/app/src/boot/globalEvent/touch.ts b/app/src/boot/globalEvent/touch.ts index a6ddf6088..2d0f5e0f1 100644 --- a/app/src/boot/globalEvent/touch.ts +++ b/app/src/boot/globalEvent/touch.ts @@ -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(); diff --git a/app/src/mobile/util/touch.ts b/app/src/mobile/util/touch.ts index c97d981c9..5e2f1d113 100644 --- a/app/src/mobile/util/touch.ts +++ b/app/src/mobile/util/touch.ts @@ -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 &&