From ce51ad7e69dbc1415eaf5f2ae846bbe89a37f69b Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 7 Feb 2018 15:55:20 +0100 Subject: [PATCH] [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 --- addons/web_editor/static/src/js/summernote.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js index 9c5ef38d43d..574836d0180 100644 --- a/addons/web_editor/static/src/js/summernote.js +++ b/addons/web_editor/static/src/js/summernote.js @@ -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); }