js: enable center selection in Commands

Enable center checkboxes and implement selection of clients from
multiple rooms in the same center.
master
Alejandro Sirgo Rica 2024-08-05 10:43:28 +02:00
parent 3e35997131
commit d1e9469326
2 changed files with 7 additions and 7 deletions

View File

@ -102,9 +102,9 @@ function configureCommandCheckboxes(context) {
});
});
// disable checkboxes outside of scope-room branches
// disable checkboxes outside of scope-center branches
$(window).on('pageshow', function(event) {
const enabledCheckboxes = checkboxes.filter('[name="scope-room"]').parent().find('input:checkbox[form="scopesForm"]');
const enabledCheckboxes = checkboxes.filter('[name="scope-center"]').parent().find('input:checkbox[form="scopesForm"]');
checkboxes.not(enabledCheckboxes).prop('disabled', true);
setParentStatus(checkboxes)
});
@ -113,12 +113,12 @@ function configureCommandCheckboxes(context) {
const checked = this.checked;
const childrenCheckboxes = $('input:checkbox[form|="scopesForm"]', this.parentNode);
// Uncheck all other checkboxes outside of the actual room branch
// Uncheck all other checkboxes outside of the actual center branch
if (checked) {
const roomBranch = findParentCheckboxes(this).add(childrenCheckboxes)
.filter('[name="scope-room"]')
const centerBranch = findParentCheckboxes(this).add(childrenCheckboxes)
.filter('[name="scope-center"]')
.parent().find('input:checkbox[form="scopesForm"]');
checkboxes.not(roomBranch).each(function () {
checkboxes.not(centerBranch).each(function () {
this.checked = false;
this.indeterminate = false;
});

View File

@ -108,7 +108,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=14"></script>
<script src="{{ url_for('static', filename='js/ogcp.js') }}?v=15"></script>
<script>
// error messages