create image logic updated

This commit is contained in:
robonetphy 2023-04-03 13:00:25 +05:30
parent c901965f71
commit 566495095e
2 changed files with 4 additions and 13 deletions

View file

@ -851,8 +851,8 @@ export default class Block extends EventsDispatcher<BlockEvents> {
*/
private compose(): HTMLDivElement {
const wrapper = $.make('div', Block.CSS.wrapper) as HTMLDivElement,
contentNode = $.make('div', Block.CSS.content),
pluginsContent = this.toolInstance.render();
contentNode = $.make('div', Block.CSS.content),
pluginsContent = this.toolInstance.render();
/**
* Saving a reference to plugin's content element for guaranteed accessing it later

View file

@ -228,19 +228,10 @@ export default class DragNDrop extends Module {
* @returns {HTMLElement} - drag image.
*/
private createDragImage(blocks: Block[]): HTMLElement {
const { BlockManager, UI } = this.Editor;
const { UI } = this.Editor;
/**
* If we are dragging only one block, return its content.
*/
if (blocks.length == 1) {
const block = BlockManager.currentBlock;
return block.holder.querySelector(`.${Block.CSS.content}`);
}
/**
* If we are dragging multiple blocks, create a drag image with all blocks content.
* Create a drag image with all blocks content.
*/
const dragImage: HTMLElement = Dom.make('div');