mirror of
https://github.com/bugsink/bugsink.git
synced 2026-01-01 10:50:47 -06:00
Implement delete functionality with confirmation modals for users. Ensure proper authorization checks are in place before deletion. Add corresponding JavaScript files to handle modal interactions and form submissions. Based on #84 Signed-off-by: Animesh Agrawal <animesh@flick2know.com>
28 lines
725 B
JavaScript
28 lines
725 B
JavaScript
"use strict";
|
|
|
|
/**
|
|
* Initializes delete functionality for entity edit pages
|
|
*/
|
|
function initializeDeleteModal() {
|
|
const modal = document.getElementById('deleteModal');
|
|
const deleteBtn = document.getElementById('deleteButton');
|
|
const cancelBtn = document.getElementById('cancelDelete');
|
|
|
|
if (!modal || !deleteBtn || !cancelBtn) {
|
|
console.error('One or more required elements not found');
|
|
return;
|
|
}
|
|
|
|
deleteBtn.addEventListener('click', () => {
|
|
modal.classList.remove('hidden');
|
|
});
|
|
|
|
cancelBtn.addEventListener('click', () => {
|
|
modal.classList.add('hidden');
|
|
});
|
|
}
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
initializeDeleteModal();
|
|
});
|