From 18a60a4e0a1c82fe827d4cf354865e838ec1d585 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 26 Jun 2025 12:07:08 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/15142 --- app/src/protyle/util/editorCommonEvent.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index 66fc716f2..34532199c 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -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; } }