mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
This commit is contained in:
parent
ccc09569e0
commit
6ff4b621b2
2 changed files with 9 additions and 1 deletions
|
|
@ -498,8 +498,11 @@ export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], type
|
||||||
avMaskElement.addEventListener("contextmenu", (event) => {
|
avMaskElement.addEventListener("contextmenu", (event) => {
|
||||||
removeAvMask(event);
|
removeAvMask(event);
|
||||||
});
|
});
|
||||||
avMaskElement.addEventListener("mousedown", (event:MouseEvent) => {
|
avMaskElement.addEventListener("mousedown", (event: MouseEvent & { target: HTMLElement }) => {
|
||||||
if (event.button === 1) {
|
if (event.button === 1) {
|
||||||
|
if (event.target.classList.contains("av__mask") && document.activeElement && document.activeElement.nodeType === 1) {
|
||||||
|
(document.activeElement as HTMLElement).blur();
|
||||||
|
}
|
||||||
removeAvMask(event);
|
removeAvMask(event);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -488,6 +488,11 @@ export const openMenuPanel = (options: {
|
||||||
window.siyuan.dragElement = undefined;
|
window.siyuan.dragElement = undefined;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
avPanelElement.addEventListener("mousedown", (event: MouseEvent & { target: HTMLElement }) => {
|
||||||
|
if (event.button === 1 && !hasClosestByClassName(event.target, "b3-menu")) {
|
||||||
|
document.querySelector(".av__panel").dispatchEvent(new CustomEvent("click", {detail: "close"}));
|
||||||
|
}
|
||||||
|
});
|
||||||
avPanelElement.addEventListener("click", (event: MouseEvent) => {
|
avPanelElement.addEventListener("click", (event: MouseEvent) => {
|
||||||
let type: string;
|
let type: string;
|
||||||
if (typeof event.detail === "string") {
|
if (typeof event.detail === "string") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue