mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
This commit is contained in:
parent
8dbd21d60d
commit
18a60a4e0a
1 changed files with 9 additions and 2 deletions
|
|
@ -842,8 +842,15 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
return;
|
||||
} else if (target.classList.contains("av__gallery-item")) {
|
||||
window.siyuan.dragElement = target;
|
||||
event.dataTransfer.setData(`${Constants.SIYUAN_DROP_GUTTER}NodeAttributeView${Constants.ZWSP}GalleryItem${Constants.ZWSP}${[target.getAttribute("data-id")]}`,
|
||||
target.outerHTML);
|
||||
const blockElement = hasClosestBlock(target);
|
||||
if (blockElement) {
|
||||
const selectIds: string[] = [];
|
||||
blockElement.querySelectorAll(".av__gallery-item--select").forEach(item => {
|
||||
selectIds.push(item.getAttribute("data-id"));
|
||||
});
|
||||
event.dataTransfer.setData(`${Constants.SIYUAN_DROP_GUTTER}NodeAttributeView${Constants.ZWSP}GalleryItem${Constants.ZWSP}${selectIds}`,
|
||||
target.outerHTML);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue