mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 01:31:39 -05:00
Add a button to cancel visit selection
This commit is contained in:
parent
d6ba3dfec8
commit
28b9e9d61d
1 changed files with 14 additions and 0 deletions
|
|
@ -918,9 +918,23 @@ export class VisitsManager {
|
||||||
selectionText.className = 'text-sm text-center mt-1 text-gray-500';
|
selectionText.className = 'text-sm text-center mt-1 text-gray-500';
|
||||||
selectionText.textContent = `${checkedBoxes.length} visits selected`;
|
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
|
// Add elements to container
|
||||||
actionsContainer.appendChild(buttonGrid);
|
actionsContainer.appendChild(buttonGrid);
|
||||||
actionsContainer.appendChild(selectionText);
|
actionsContainer.appendChild(selectionText);
|
||||||
|
actionsContainer.appendChild(cancelButton);
|
||||||
|
|
||||||
// Insert after the lowest visit item
|
// Insert after the lowest visit item
|
||||||
lowestVisitItem.insertAdjacentElement('afterend', actionsContainer);
|
lowestVisitItem.insertAdjacentElement('afterend', actionsContainer);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue