[FIX] web_editor: allow deleting all images in table cells

Before this commit, it was impossible to delete an image which was a
direct child of a table cell using the trash-icon button in the
toolbar.

This commit fixes the behavior by changing the logic quite a lot, so
it is kinda tricky (see https://github.com/odoo/odoo/commit/25849e918651eba080dac3af4e4fcdc8f1280241
for more explaination).

Closes https://github.com/odoo/odoo/issues/22523
This commit is contained in:
qsm-odoo
2018-02-08 10:48:14 +01:00
parent 8dfd6a2507
commit ce51ad7e69
@@ -1313,7 +1313,7 @@ function summernote_keydown_clean (field) {
function remove_table_content(r) {
var ancestor = r.commonAncestor();
var nodes = dom.listBetween(r.sc, r.ec);
var nodes = dom.listBetween(r.sc, r.ec, r.so, r.eo);
if (dom.isText(r.sc)) {
r.sc.textContent = r.sc.textContent.slice(0, r.so);
}