Skip to content

Commit

Permalink
LMSA-9483 - change var to let in decrosslist.js
Browse files Browse the repository at this point in the history
  • Loading branch information
gjthomas committed Nov 18, 2024
1 parent 6fce576 commit a47d574
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main/resources/static/js/decrosslisting.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/

jQuery(document).ready(function() {
var resultsMessage = document.getElementById('results-message');
let resultsMessage = document.getElementById('results-message');

if (resultsMessage != null) {
resultsMessage.focus();
Expand All @@ -56,18 +56,18 @@ jQuery(document).ready(function() {

function checkboxCounter() {
// Get all the selected checkboxes, except the "select-all" one up in the table header
var $checkboxes = $('#decrosslist-form input[type="checkbox"]');
let $checkboxes = $('#decrosslist-form input[type="checkbox"]');

// update the count
$checkboxes.change(function() {
var countCheckedCheckboxes = $checkboxes.filter(':checked').length;
let countCheckedCheckboxes = $checkboxes.filter(':checked').length;
$('#sections-selected').text(countCheckedCheckboxes + ' selected');
});
}

function updateCounter() {
var $checkboxes = $('#decrosslist-form input[type="checkbox"]');
var countCheckedCheckboxes = $checkboxes.filter(':checked').length;
let $checkboxes = $('#decrosslist-form input[type="checkbox"]');
let countCheckedCheckboxes = $checkboxes.filter(':checked').length;
$('#sections-selected').text(countCheckedCheckboxes + ' selected');
}

Expand All @@ -93,13 +93,13 @@ function submitSisIdForm(button) {

function validateCheckboxForm(button) {
// Get all the selected checkboxes, except the "select-all" one up in the table header
var checkboxes = $('#decrosslist-form input[type="checkbox"]').not("#checkbox-select-all").filter(':checked').length;
let checkboxes = $('#decrosslist-form input[type="checkbox"]').not("#checkbox-select-all").filter(':checked').length;

if (checkboxes > 0) {
buttonLoading(button);
document.getElementById('decrosslist-form').submit();
} else {
var checkboxValidationMessage = document.getElementById('checkbox-validation-message');
let checkboxValidationMessage = document.getElementById('checkbox-validation-message');
checkboxValidationMessage.classList.remove('rvt-display-none');

let firstCheckbox = $('#decrosslist-form input[type="checkbox"]').not("#checkbox-select-all").first();
Expand All @@ -116,8 +116,8 @@ function buttonLoading(button) {
document.getElementById("submitValue").value = button.dataset.action;
}
button.setAttribute("aria-busy", true);
var buttonsToDisable = document.getElementsByTagName('button');
for(var i = 0; i < buttonsToDisable.length; i++) {
let buttonsToDisable = document.getElementsByTagName('button');
for(let i = 0; i < buttonsToDisable.length; i++) {
buttonsToDisable[i].disabled = true;
}
button.classList.add("rvt-button--loading");
Expand Down

0 comments on commit a47d574

Please sign in to comment.