Added null check for the button group

This commit is contained in:
atownson 2024-09-23 13:26:47 -05:00
parent 0cf8264c0e
commit 1bfb6e6f34
3 changed files with 3 additions and 0 deletions

Binary file not shown.

Binary file not shown.

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');