mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
This commit is contained in:
parent
807db89c5e
commit
41fcb61908
3 changed files with 5 additions and 5 deletions
|
|
@ -67,7 +67,7 @@ export const openMenuPanel = (protyle: IProtyle,
|
|||
return;
|
||||
}
|
||||
const target = event.target as HTMLElement;
|
||||
const targetElement = hasClosestByAttribute(target, "data-id", null);
|
||||
const targetElement = hasClosestByAttribute(target, "draggable", "true");
|
||||
if (!targetElement ||
|
||||
(!targetElement.classList.contains("dragover__top") && !targetElement.classList.contains("dragover__bottom"))) {
|
||||
return;
|
||||
|
|
@ -154,7 +154,7 @@ export const openMenuPanel = (protyle: IProtyle,
|
|||
let dragoverElement: HTMLElement;
|
||||
avPanelElement.addEventListener("dragover", (event: DragEvent) => {
|
||||
const target = event.target as HTMLElement;
|
||||
const targetElement = hasClosestByAttribute(target, "data-id", null);
|
||||
const targetElement = hasClosestByAttribute(target, "draggable", "true");
|
||||
if (!targetElement || targetElement.isSameNode(window.siyuan.dragElement)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -172,7 +172,7 @@ export const openMenuPanel = (protyle: IProtyle,
|
|||
});
|
||||
avPanelElement.addEventListener("dragleave", (event) => {
|
||||
const target = event.target as HTMLElement;
|
||||
const targetElement = hasClosestByAttribute(target, "data-id", null);
|
||||
const targetElement = hasClosestByAttribute(target, "draggable", "true");
|
||||
if (targetElement) {
|
||||
targetElement.classList.remove("dragover__top", "dragover__bottom");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue