mirror of https://git.48k.eu/ogcp
Check scopes checkboxes recursively
Otherwise, nested scopes are not checked and mislead users. When a scope is checked, we search all its children and check them too.multi-ogserver
parent
9a6508c686
commit
5d9ad78ed3
|
@ -9,6 +9,19 @@ function storeCheckboxStatus(checkbox) {
|
|||
localStorage.removeItem(checkbox.name);
|
||||
}
|
||||
|
||||
function checkChildrenCheckboxes() {
|
||||
const checkboxes = $('input:checkbox[form|="scopesForm"]')
|
||||
|
||||
checkboxes.on('change', function () {
|
||||
const checked = this.checked
|
||||
const children = $('input:checkbox', this.parentNode).not(this)
|
||||
children.each(function () {
|
||||
this.checked = checked;
|
||||
storeCheckboxStatus(this);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function keepSelectedClients() {
|
||||
const checkboxes = $('input:checkbox[form|="scopesForm"]')
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
updateScopeState();
|
||||
keepScopesTreeState();
|
||||
keepSelectedClients();
|
||||
checkChildrenCheckboxes();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue