如何通过在 froala 编辑器中插入新图像来识别移动图像?

问题描述 投票:0回答:0

我正在使用带有可拖动插件和

imageMove: true
选项的 Froala WYSIWYG 编辑器,因此我可以在编辑器中移动已经插入的图像。我也在使用 drop 事件,我想区分移动现有图像和将新图像插入编辑器。

froala.events.on('drop', event => {
    const files = event.originalEvent.dataTransfer.files
    const isImageMove = ??? // This should recognize if image was already inserted in the editor and now it was just moved.
    console.log(isImageMove ? 'Image was moved' : 'Image was inserted')
})

有什么办法可以做到这一点吗?

javascript froala
© www.soinside.com 2019 - 2024. All rights reserved.