Skip to content

Commit

Permalink
Merge pull request #3 from janeznovak/inlineImageRemove
Browse files Browse the repository at this point in the history
Added check for inlineImage name of images
  • Loading branch information
shibbirweb authored Jan 26, 2022
2 parents 99fd8a9 + f6a96bf commit a4dd48e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ImageRemoveEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @author MD. Shibbir Ahmed <shibbirweb@gmail.com> (http://shibbir.me/)
*
*/
export default class ImageRemoveEvent {
export default class ImageRemoveEvent {

constructor(editor, configuration) {
this.editor = editor
Expand Down Expand Up @@ -38,7 +38,7 @@ export default class ImageRemoveEvent {
for (let i = 0; i < changes.length; i++){
const change = changes[i]
// if image remove exists
if (change && change.type === 'remove' && change.name === 'image') {
if (change && change.type === 'remove' && (change.name === 'image' || change.name === 'imageInline')) {
hasNoImageRemoved = false
break
}
Expand All @@ -50,7 +50,7 @@ export default class ImageRemoveEvent {
}

// get removed nodes
const removedNodes = changes.filter(change => (change.type === 'insert' && change.name === 'image'))
const removedNodes = changes.filter(change => (change.type === 'insert' && (change.name === 'image' || change.name === 'imageInline')))

// removed images src
const removedImagesSrc = [];
Expand Down

0 comments on commit a4dd48e

Please sign in to comment.