This commit is contained in:
Vanessa 2023-04-02 12:03:32 +08:00
parent 2d190bf708
commit 541480c9c4
3 changed files with 7 additions and 3 deletions

View file

@ -132,6 +132,7 @@ export class Menu {
}); });
} }
this.popup({x: 0, y: position === "bottom" ? window.innerHeight / 2 : 0}); this.popup({x: 0, y: position === "bottom" ? window.innerHeight / 2 : 0});
this.element.scrollTop = 0;
} }
} }

View file

@ -5,4 +5,5 @@ export const closePanel = () => {
const maskElement = document.querySelector(".side-mask") as HTMLElement; const maskElement = document.querySelector(".side-mask") as HTMLElement;
maskElement.classList.add("fn__none"); maskElement.classList.add("fn__none");
maskElement.style.opacity = ""; maskElement.style.opacity = "";
window.siyuan.menus.menu.remove();
}; };

View file

@ -33,6 +33,7 @@ export const handleTouchEnd = (event: TouchEvent) => {
if (!clientX || !clientY || typeof yDiff === "undefined" || if (!clientX || !clientY || typeof yDiff === "undefined" ||
hasClosestByClassName(target, "b3-dialog") || hasClosestByClassName(target, "b3-dialog") ||
hasClosestByClassName(target, "keyboard") || hasClosestByClassName(target, "keyboard") ||
hasClosestByAttribute(target, "id", "commonMenu") ||
hasClosestByAttribute(target, "id", "model") hasClosestByAttribute(target, "id", "model")
) { ) {
return; return;
@ -146,6 +147,7 @@ export const handleTouchMove = (event: TouchEvent) => {
if (!clientX || !clientY || if (!clientX || !clientY ||
hasClosestByClassName(target, "b3-dialog") || hasClosestByClassName(target, "b3-dialog") ||
hasClosestByClassName(target, "keyboard") || hasClosestByClassName(target, "keyboard") ||
hasClosestByAttribute(target, "id", "commonMenu") ||
hasClosestByAttribute(target, "id", "model")) { hasClosestByAttribute(target, "id", "model")) {
return; return;
} }
@ -217,5 +219,5 @@ export const handleTouchMove = (event: TouchEvent) => {
const transformMask = (opacity: number) => { const transformMask = (opacity: number) => {
const maskElement = document.querySelector(".side-mask") as HTMLElement; const maskElement = document.querySelector(".side-mask") as HTMLElement;
maskElement.classList.remove("fn__none"); maskElement.classList.remove("fn__none");
maskElement.style.opacity = Math.min((1 - opacity), 0.86).toString(); maskElement.style.opacity = Math.min((1 - opacity), 0.68).toString();
}; };