4

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:

  • Press Backspace when the image is selected
  • Press Backspace wehn the cursor is in front of the image

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

Has anyone found a way to delete an inline image?

pulse00
  • 1,294
  • 1
  • 16
  • 25

2 Answers2

2

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

luc
  • 41,928
  • 25
  • 127
  • 172
0

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. :)

Nico
  • 881
  • 1
  • 6
  • 19