summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-09-19 16:29:31 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-09-27 09:48:36 +0200
commit9961c4bc8db111c2ea086b1f77741a454545a005 (patch)
treeebc39e91748d7bee55fee2e311d9b769c3c4f530
parent58f295fb1cbc78db91d16708ea15818f29e451b7 (diff)
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.
-rw-r--r--ogcp/static/js/ogcp.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js
index 875084d..8fb9838 100644
--- a/ogcp/static/js/ogcp.js
+++ b/ogcp/static/js/ogcp.js
@@ -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');
}
}