10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-25 13:53:48 +01:00

Add more jQuery

This commit is contained in:
Mickaël Véril 2020-05-19 10:17:55 +02:00
parent 31c534b9f5
commit b205e180f8

View File

@ -1,14 +1,14 @@
function nestedCheckbox_change(e) { function nestedCheckbox_change(e) {
checkbox = e.target; checkbox = $(e.target);
//Apply children //Apply children
if (!checkbox.indeterminate) { if (!checkbox.is(":indeterminate")) {
var ul = $(checkbox).parent("li").next("ul") var ul = checkbox.parent("li").next("ul")
if (ul.length != 0) { if (ul.length != 0) {
ul.children("li").children("input[type=checkbox]").prop("checked", checkbox.checked); ul.children("li").children("input[type=checkbox]").prop("checked", checkbox.is(":checked"));
} }
} }
//Apply parent //Apply parent
var ul=$(checkbox).parent("li").parent("ul") var ul=checkbox.parent("li").parent("ul")
var checkbox=$(ul).prev("li").children("input[type=checkbox]") var checkbox=$(ul).prev("li").children("input[type=checkbox]")
checkboxes=ul.children("li").children("input[type=checkbox]") checkboxes=ul.children("li").children("input[type=checkbox]")
var checkeds=Array.from(checkboxes).map(el=>el.checked) var checkeds=Array.from(checkboxes).map(el=>el.checked)