summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/editor/summernote.js
diff options
context:
space:
mode:
authorGorash <chm@odoo.com>2019-09-18 11:39:32 +0000
committerDavid Monjoie <dmo@odoo.com>2019-09-19 07:40:47 +0000
commitd1f25b178a165f2575a142f2a886ea2d6234cd51 (patch)
treea8a1459c2bdbb1a6f56bfc42fc37f630548c1cd9 /addons/web_editor/static/src/js/editor/summernote.js
parentf7c2cb088c2be1dbf5c85b3a47a77be68fb0ea84 (diff)
[FIX] web_editor: recursive checkbox check
In multi-level checkboxes, if there is only one checkbox per level, the expected behavior is that all checkbox will be checked if one of them is checked. This was not the case before this commit.
Diffstat (limited to 'addons/web_editor/static/src/js/editor/summernote.js')
-rw-r--r--addons/web_editor/static/src/js/editor/summernote.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/editor/summernote.js b/addons/web_editor/static/src/js/editor/summernote.js
index 6c62758142d..03642ff177f 100644
--- a/addons/web_editor/static/src/js/editor/summernote.js
+++ b/addons/web_editor/static/src/js/editor/summernote.js
@@ -2469,6 +2469,7 @@ function mouseDownChecklist (e) {
if (!dom.isLi(e.target) || !$(e.target).parent('ul.o_checklist').length || e.offsetX > 0) {
return;
}
+ e.stopPropagation();
e.preventDefault();
var checked = $(e.target).hasClass('o_checked');
$(e.target).toggleClass('o_checked', !checked);
@@ -2478,12 +2479,14 @@ function mouseDownChecklist (e) {
});
if (checked) {
$sublevel.removeClass('o_checked');
- $parents.prev('ul.o_checklist li').removeClass('o_checked');
+ do {
+ $parents = $parents.prev('ul.o_checklist li').removeClass('o_checked');
+ } while ($parents.length);
} else {
$sublevel.addClass('o_checked');
var $lis;
do {
- $lis = $parents.not(':has(li:not(.o_checked))').prev('ul.o_checklist li:not(.o_checked)');
+ $lis = $parents.not(':has(li[id^="checklist-id"]:not(.o_checked))').prev('ul.o_checklist li:not(.o_checked)');
$lis.addClass('o_checked');
} while ($lis.length);
}