mirror of
https://github.com/kevinveenbirkenbach/homepage.veen.world.git
synced 2025-09-10 11:47:10 +02:00
Implemented header and footer menu
This commit is contained in:
18
app/static/js/dynamic-modal.js
Normal file
18
app/static/js/dynamic-modal.js
Normal file
@@ -0,0 +1,18 @@
|
||||
function openDynamicPopup(subitem) {
|
||||
// Set modal title and content
|
||||
document.getElementById('dynamicModalLabel').innerText = subitem.description;
|
||||
const modalContent = document.getElementById('dynamicModalContent');
|
||||
modalContent.value = subitem.address;
|
||||
|
||||
// Add copy functionality
|
||||
document.getElementById('dynamicCopyButton').addEventListener('click', function () {
|
||||
modalContent.select();
|
||||
navigator.clipboard.writeText(modalContent.value)
|
||||
.then(() => alert('Content copied to clipboard!'))
|
||||
.catch(() => alert('Failed to copy content.'));
|
||||
});
|
||||
|
||||
// Show the modal
|
||||
const modal = new bootstrap.Modal(document.getElementById('dynamicModal'));
|
||||
modal.show();
|
||||
}
|
Reference in New Issue
Block a user