Add a button to cancel visit selection

This commit is contained in:
Eugene Burmakin 2025-03-12 21:57:30 +01:00
parent d6ba3dfec8
commit 28b9e9d61d

View file

@ -918,9 +918,23 @@ export class VisitsManager {
selectionText.className = 'text-sm text-center mt-1 text-gray-500';
selectionText.textContent = `${checkedBoxes.length} visits selected`;
// Add cancel selection button
const cancelButton = document.createElement('button');
cancelButton.className = 'btn btn-xs btn-neutral w-full mt-2';
cancelButton.textContent = 'Cancel Selection';
cancelButton.addEventListener('click', () => {
// Uncheck all checkboxes
checkedBoxes.forEach(checkbox => {
checkbox.checked = false;
});
// Update UI to remove action buttons
this.updateMergeUI(container);
});
// Add elements to container
actionsContainer.appendChild(buttonGrid);
actionsContainer.appendChild(selectionText);
actionsContainer.appendChild(cancelButton);
// Insert after the lowest visit item
lowestVisitItem.insertAdjacentElement('afterend', actionsContainer);