generated from hjess/PythonTemplateProject
Bug somewhere
Some checks failed
Build, Push, and Deploy to Nomad / docker-nomad (push) Failing after 4m38s
Some checks failed
Build, Push, and Deploy to Nomad / docker-nomad (push) Failing after 4m38s
This commit is contained in:
27
static/js/modal_handler.js
Normal file
27
static/js/modal_handler.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// Open a specific modal
|
||||
function openModal(modalId) {
|
||||
const modal = document.getElementById(modalId);
|
||||
if (modal) {
|
||||
modal.style.display = 'flex';
|
||||
} else {
|
||||
console.error(`Modal with ID "${modalId}" not found.`);
|
||||
}
|
||||
}
|
||||
|
||||
// Close a specific modal
|
||||
function closeModal(modalId) {
|
||||
const modal = document.getElementById(modalId);
|
||||
if (modal) {
|
||||
modal.style.display = 'none';
|
||||
} else {
|
||||
console.error(`Modal with ID "${modalId}" not found.`);
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure all modals are hidden on page load
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const modals = document.querySelectorAll('.modal'); // Select all modals
|
||||
modals.forEach(modal => {
|
||||
modal.style.display = 'none';
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user