Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I bind a new event "removeMedia" with the delete button? #605

Closed
ghost opened this issue Sep 15, 2014 · 7 comments
Closed

How can I bind a new event "removeMedia" with the delete button? #605

ghost opened this issue Sep 15, 2014 · 7 comments

Comments

@ghost
Copy link

ghost commented Sep 15, 2014

Whenever we initiate a media (image/video) in the content area, upon selection of that media a popover action menu appears including a delete button which upon click removes the media from the content area but that does not suffice a lot of real application needs. So how about an api / event say "removeMedia" which developer can override to do whatever he wants upon media removal?

@ghost
Copy link
Author

ghost commented Jan 19, 2015

+1
Also looking for this. Need to get current image (uploaded with summernote) URL to delete it from server.

@aftab-pentaloop
Copy link

+1

@easylogic
Copy link
Member

Only if image is added, it can use onMediaDelete event.

$(".summernote").summernote({
    onMediaDelete : function($target, editor, $editable) {
          console.log($target[0].src); // img 

         // remove element in editor 
         $target.remove();
    }
});

Video do not implements about onMediaDelete event yet

@danilodeveloper
Copy link

Hi @easylogic!
Where the onMediaDelete is fired in the summernote code?

@danilodeveloper
Copy link

I found it!

Thank you!!

@XIAOXIAOSIYU
Copy link

Never get the onMediaDelete fired, anyone did it?

@lqez
Copy link
Member

lqez commented Nov 24, 2017

Yes, onMediaDelete was made for it, but as you see #1242, it does not work well. Let's keep talking at #1242.

@lqez lqez closed this as completed Nov 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants