diff options
-rw-r--r-- | ogcp/static/js/ogcp.js | 17 | ||||
-rw-r--r-- | ogcp/templates/base.html | 2 |
2 files changed, 16 insertions, 3 deletions
diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js index 5c15b30..b57fca7 100644 --- a/ogcp/static/js/ogcp.js +++ b/ogcp/static/js/ogcp.js @@ -399,8 +399,21 @@ function limitCheckboxes(context) { const checkboxes = $('input:checkbox[form|="scopesForm"]'); checkboxes.on('change', function () { - const checked = this; - checkboxes.filter((i, c) => c !== checked).prop('checked', false); + const currentCheckbox = $(this); + const currentParentRoom = currentCheckbox.attr('data-parent-room'); + + checkboxes.each(function () { + const checkbox = $(this); + const checkboxParentRoom = checkbox.attr('data-parent-room'); + + if (currentCheckbox.is(checkbox)) { + return; + } + const isSibling = currentParentRoom && checkboxParentRoom && checkboxParentRoom === currentParentRoom; + if (!isSibling) { + checkbox.prop('checked', false); + } + }); checkScopeServer(); diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html index 30dc3bb..22fe086 100644 --- a/ogcp/templates/base.html +++ b/ogcp/templates/base.html @@ -111,7 +111,7 @@ <!-- ChartJS --> <script src="{{ url_for('static', filename='AdminLTE/plugins/chart.js/Chart.min.js') }}"></script> - <script src="{{ url_for('static', filename='js/ogcp.js') }}?v=7"></script> + <script src="{{ url_for('static', filename='js/ogcp.js') }}?v=8"></script> <script> // error messages |