pulse00
pulse00

Reputation: 1314

Delete an image in the aloha-editor

The Aloha Editor ships with an image plugin that enables users to edit images inline. However, i've not found a way to delete an image in the editor. I'm on a Mac, and i've tried:

There's also no "delete image" button in the floating toolbar.

Has anyone found a way to delete an inline image?

Upvotes: 4

Views: 605

Answers (2)

luc
luc

Reputation: 43116

I have a similar issue. On windows, I can delete an image by pressing the 'Del' key. However, I've used a float:right css to position the image automatically and in this case I can not delete it anymore.

I have added the following workaround in my page. It makes possible to delete the image by double-clicking on it.

$(function() {
  $('.aloha img').live('dblclick', function(event) {
    if (confirm("Supprimer l'image?")) {
      event.preventDefault();
      $(this).remove();
    }
    return false;
  });
});

This seems to works on firefox. However sometimes I can see the image to be magically restored. On Chrome this magic behavior happens every time.

I keep investigating and I'll keep you informed if I fix this problem in a clean way.


Update: this is now fixed in aloha-editor. If you select the image and clear the src field value. See https://github.com/alohaeditor/Aloha-Editor/issues/513

Upvotes: 2

Nico
Nico

Reputation: 931

You can delete the image URL from the URL field that appears when you click on the inserted image. That makes the image disappear for me. Not very convenient though. :)

Upvotes: 0

Related Questions