Improve scopes tree from Commands

Commit 648a1a315e1d35f67c5301833bddd3753cc51793 changes do not work well
with large scopes trees. It takes several minutes to check a scope.

Improve javascript code to speed up scope selection.
async-tree
Javier Sánchez Parra 2022-09-19 16:29:31 +02:00
parent 58f295fb1c
commit 9961c4bc8d
1 changed files with 10 additions and 3 deletions

View File

@ -91,7 +91,11 @@ function checkChildrenCheckboxes() {
if (this.name === 'scope-room') {
const others = $('input:checkbox[form|="scopesForm"]').not(this);
others.prop('checked', false);
others.trigger('change');
others.each(function() {
showSelectedClient(this);
storeCheckboxStatus(this);
});
//others.trigger('change');
} else {
// Look for room, deselect all other rooms
const selectedRoom = $('[data-room="' + $(this).data('parentRoom') + '"]');
@ -99,9 +103,12 @@ function checkChildrenCheckboxes() {
others.prop('checked', false).prop('indeterminate', false);
others.each(function() {
const checks = $(this).parent().find('input:checkbox').prop('checked', false);
checks.trigger('change');
storeCheckboxStatus(this);
checks.each(function() {
showSelectedClient(this);
storeCheckboxStatus(this);
});
});
others.trigger('change');
}
}