js: restrict the checkbox filter to the sidebar

Prevent accidental processing of checkboxes outside the sidebar.
master
Alejandro Sirgo Rica 2024-09-16 13:46:28 +02:00
parent db2869088f
commit 2ca2215ed6
2 changed files with 7 additions and 7 deletions

View File

@ -47,7 +47,7 @@ function showSelectedClient(client_checkbox) {
}
function showSelectedClientsOnEvents() {
const checkboxes = $('input:checkbox[form|="scopesForm"]');
const checkboxes = $('#sidebar input:checkbox');
checkboxes.on('change show-client', function () {
showSelectedClient(this);
@ -111,7 +111,7 @@ function configureCommandCheckboxes(context) {
checkboxes.on('change', function () {
const checked = this.checked;
const childrenCheckboxes = $('input:checkbox[form|="scopesForm"]', this.parentNode);
const childrenCheckboxes = $('#sidebar input:checkbox', this.parentNode);
// Uncheck all other checkboxes outside of the actual center branch
if (checked) {
@ -138,7 +138,7 @@ function configureCommandCheckboxes(context) {
}
function keepSelectedClients(context) {
const checkboxes = $('input:checkbox[form|="scopesForm"]')
const checkboxes = $('#sidebar input:checkbox')
checkboxes.on('change', function (event) {
storeCheckboxStatus(this, context);
@ -334,7 +334,7 @@ function checkRepoServer() {
}
function checkFolderParent(context) {
const folder = $('input:checkbox[form|="scopesForm"][name="folder"]')
const folder = $('#sidebar input:checkbox[name="folder"]')
folder.on('change', function() {
const folder_parent = $('#' + $.escapeSelector(this.dataset.parentInput));
folder_parent.prop('checked', this.checked);
@ -343,7 +343,7 @@ function checkFolderParent(context) {
}
function limitCheckboxes(context) {
const checkboxes = $('input:checkbox[form|="scopesForm"]');
const checkboxes = $('#sidebar input:checkbox');
checkboxes.on('change', function () {
const currentCheckbox = $(this);
@ -372,7 +372,7 @@ function limitCheckboxes(context) {
}
function checkScopeServer() {
const servers = $('input:checkbox[form|="scopesForm"][name="scope-server"]');
const servers = $('#sidebar input:checkbox[name="scope-server"]');
servers.each(function() {
const checkbox = this;
const checkboxChildren = $('input:checkbox', this.parentNode).not(this);

View File

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