0

You know, Summernote is some of powerful text editor and has good documentation about it which means it is easy to use for me. But I couldn't find any docs about how to deleting insertedImages (which drag and drop) with backspace or delete button from keyboard.

I've seen this article Summernote - Delete image from server but not very clear for me how I am suppose to do

https://github.com/summernote/summernote/issues/605 and https://github.com/summernote/summernote/issues/884 have a same goals that is deleting image from summernote button, not from keyboard.

Is there any ways to do that? is it possible? and what I'm missing?

Community
  • 1
  • 1

2 Answers2

0

The documentation sucks for anything more than the basics. Anyway have you tried this:

$(".summernote").summernote({
    onMediaDelete : function($target, editor, $editable) {
        console.log($target.context.dataset.filename);         
        $target.remove();
        console.log("all gone!");     
    }
})
Alex Stephens
  • 3,017
  • 1
  • 36
  • 41
0

summernote does not have this option to control the extension, it accepts all kinds of images, but I needed to release the file uploaded in pdf and found the solution check:

How to set image extensions for insert image dialog of Summernote

Navi
  • 171
  • 5