🎨 drag
This commit is contained in:
parent
af651215a9
commit
de9347fc97
2 changed files with 4 additions and 6 deletions
|
@ -494,7 +494,7 @@ export class Files extends Model {
|
|||
});
|
||||
});
|
||||
this.element.addEventListener("drop", async (event: DragEvent & { target: HTMLElement }) => {
|
||||
const newElement = hasClosestByTag(event.target, "LI");
|
||||
const newElement = this.element.querySelector(".dragover, .dragover__bottom, .dragover__top");
|
||||
if (!newElement) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -110,10 +110,8 @@ export const openMenuPanel = (options: {
|
|||
event.stopPropagation();
|
||||
return;
|
||||
}
|
||||
const target = event.target as HTMLElement;
|
||||
const targetElement = hasClosestByAttribute(target, "draggable", "true");
|
||||
if (!targetElement ||
|
||||
(!targetElement.classList.contains("dragover__top") && !targetElement.classList.contains("dragover__bottom"))) {
|
||||
const targetElement = avPanelElement.querySelector(".dragover__bottom, .dragover__top") as HTMLElement;
|
||||
if (!targetElement) {
|
||||
return;
|
||||
}
|
||||
let type = "columns";
|
||||
|
@ -298,7 +296,7 @@ export const openMenuPanel = (options: {
|
|||
const target = event.target as HTMLElement;
|
||||
let targetElement = hasClosestByAttribute(target, "draggable", "true");
|
||||
if (!targetElement) {
|
||||
targetElement = hasClosestByAttribute(document.elementFromPoint(event.clientX, event.clientY - 1), "draggable", "true")
|
||||
targetElement = hasClosestByAttribute(document.elementFromPoint(event.clientX, event.clientY - 1), "draggable", "true");
|
||||
}
|
||||
if (!targetElement || targetElement.isSameNode(window.siyuan.dragElement)) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue