mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-11 07:02:33 +01:00
This commit is contained in:
parent
0fa9726bb8
commit
0cec3bb0ec
4 changed files with 21 additions and 17 deletions
|
|
@ -85,19 +85,13 @@ export const initWindowEvent = (app: App) => {
|
|||
target.classList.contains("protyle-background__icon")) {
|
||||
return;
|
||||
}
|
||||
// 触摸屏背景和嵌入块按钮显示
|
||||
const backgroundElement = hasClosestByClassName(target, "protyle-background");
|
||||
if (backgroundElement) {
|
||||
if (!globalTouchStart(event)) {
|
||||
backgroundElement.classList.toggle("protyle-background--mobileshow");
|
||||
}
|
||||
return;
|
||||
}
|
||||
const embedBlockElement = isInEmbedBlock(target);
|
||||
if (embedBlockElement) {
|
||||
embedBlockElement.firstElementChild.classList.toggle("protyle-icons--show");
|
||||
return;
|
||||
}
|
||||
// 触摸屏背景和嵌入块按钮显示
|
||||
globalTouchStart(event);
|
||||
}, false);
|
||||
document.addEventListener("touchend", (event) => {
|
||||
if (isIPad()) {
|
||||
|
|
|
|||
|
|
@ -49,6 +49,13 @@ export const globalTouchStart = (event: TouchEvent) => {
|
|||
event.stopImmediatePropagation();
|
||||
return true;
|
||||
}
|
||||
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;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue