mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-07-03 14:09:06 +02:00
♻️
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 &&
|
||||
|
||||
Reference in New Issue
Block a user