Added null check for the button group

This commit is contained in:
atownson
2024-09-23 13:26:47 -05:00
parent 72f569fc67
commit 0741da6366
3 changed files with 6 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -7,6 +7,9 @@ import { getElements } from '../util';
function toggleFloat(): void {
const checkedCheckboxes = document.querySelector<HTMLInputElement>('input[type="checkbox"][name="pk"]:checked');
const buttonGroup = document.querySelector<HTMLDivElement>('div.form.form-horizontal div.btn-list');
if (!buttonGroup) {
return;
}
const isFloating = buttonGroup.classList.contains('btn-float-group-left');
if (checkedCheckboxes !== null && !isFloating) {
buttonGroup.classList.add('btn-float-group-left');