From e2ca200046850bb0a465b821b65fe59a8f4c2667 Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Tue, 26 Feb 2019 13:48:00 +0000 Subject: [PATCH] [FIX] web_editor: remove o_checklist class on convert to ordered list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Converting a checklist into an ordered list didn't remove the o_checklist class. In consequence, converting a checklist to an ordered list and then to an unordered list failed as the unordered list with the o_checklist class is effectively a checklist. This fixes that bug. closes odoo/odoo#31432 Signed-off-by: Adrien Dieudonné (adr) --- addons/web_editor/static/src/js/wysiwyg/plugin/bullet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/plugin/bullet.js b/addons/web_editor/static/src/js/wysiwyg/plugin/bullet.js index dc2a444384b..d134bf7c5e5 100644 --- a/addons/web_editor/static/src/js/wysiwyg/plugin/bullet.js +++ b/addons/web_editor/static/src/js/wysiwyg/plugin/bullet.js @@ -165,10 +165,10 @@ var BulletPlugin = AbstractPlugin.extend({ // convert ul <-> ol var ul; + $(ol).removeClass('o_checklist'); if (sorted === 'checklist' && current === "ul") { ul = ol; } else if (sorted === 'ul' && current === 'checklist') { - $(ol).removeClass('o_checklist'); ul = ol; } else { ul = this.document.createElement(sorted === "ol" ? "ol" : "ul");