@@ -850,12 +850,16 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
850850 } else if ( target . classList . contains ( "av__gallery-item" ) ) {
851851 const blockElement = hasClosestBlock ( target ) ;
852852 if ( blockElement ) {
853+ target . classList . add ( "av__gallery-item--select" ) ;
853854 const ghostElement = document . createElement ( "div" ) ;
854- ghostElement . className = "protyle-wysiwyg protyle-wysiwyg--attr" ;
855- ghostElement . append ( processClonePHElement ( target . cloneNode ( true ) as Element ) ) ;
856- ghostElement . setAttribute ( "style" , `position:fixed;opacity:.1;padding:0;
857- width:${ target . clientWidth } px;;height:${ target . clientHeight } px;` ) ;
858- ghostElement . querySelector ( ".av__gallery-fields" ) . setAttribute ( "style" , "background-color: var(--b3-theme-background)" ) ;
855+ ghostElement . className = "protyle-wysiwyg protyle-wysiwyg--attr " + target . parentElement . className ;
856+ blockElement . querySelectorAll ( ".av__gallery-item--select" ) . forEach ( item => {
857+ const cloneItem = processClonePHElement ( item . cloneNode ( true ) as Element ) ;
858+ cloneItem . setAttribute ( "style" , `width:${ item . clientWidth } px;;height:${ item . clientHeight } px;` ) ;
859+ cloneItem . querySelector ( ".av__gallery-fields" ) . setAttribute ( "style" , "background-color: var(--b3-theme-background)" ) ;
860+ ghostElement . append ( cloneItem ) ;
861+ } ) ;
862+ ghostElement . setAttribute ( "style" , "position:fixed;opacity:.1;padding:0;z-index:1;" ) ;
859863 document . body . append ( ghostElement ) ;
860864 event . dataTransfer . setDragImage ( ghostElement , - 10 , - 10 ) ;
861865 setTimeout ( ( ) => {
@@ -870,7 +874,7 @@ width:${target.clientWidth}px;;height:${target.clientHeight}px;`);
870874 selectIds . push ( target . getAttribute ( "data-id" ) ) ;
871875 }
872876 event . dataTransfer . setData ( `${ Constants . SIYUAN_DROP_GUTTER } NodeAttributeView${ Constants . ZWSP } GalleryItem${ Constants . ZWSP } ${ selectIds } ` ,
873- target . outerHTML ) ;
877+ ghostElement . outerHTML ) ;
874878 }
875879 return ;
876880 }
0 commit comments