From 9961c4bc8db111c2ea086b1f77741a454545a005 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Mon, 19 Sep 2022 16:29:31 +0200 Subject: 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. --- ogcp/static/js/ogcp.js | 13 ++++++++++--- 1 file 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'); } } -- cgit v1.2.3-18-g5258