10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-25 05:43:46 +01:00

Fix nestedCheckbox parent behaviour

This commit is contained in:
Mickaël Véril 2020-01-09 11:12:46 +01:00
parent abae66d2b3
commit 5a61b3fc92

View File

@ -12,13 +12,13 @@ function nestedCheckbox_change(e) {
var checkbox=$(ul).prev("li").children("input[type=checkbox]")
checkboxes=ul.children("li").children("input[type=checkbox]")
var checkeds=Array.from(checkboxes).map(el=>el.checked)
var scheckeds=new Set(checkeds)
if (scheckeds.size>1) {
$(checkbox).prop("checked",false);
var scheckeds=Array.from(new Set(checkeds))
if (scheckeds.length>1) {
checkbox.prop("checked",false);
checkbox.prop("indeterminate",true);
}
else{
checkbox.indeterminate=false;
checkbox=scheckeds[0];
checkbox.prop("indeterminate",false);
checkbox.prop("checked",scheckeds[0]);
}
}