mirror of
https://github.com/rickbarrette/redmine_qbo_calendar.git
synced 2026-10-04 04:40:43 -04:00
22 lines
737 B
JavaScript
22 lines
737 B
JavaScript
document.addEventListener('DOMContentLoaded', function() {
|
|
document.addEventListener('click', function(e) {
|
|
const clickedBlock = e.target.closest('.appointment-block');
|
|
const clickedLink = e.target.closest('a');
|
|
|
|
// Allow standard links (like subject title or avatar links) to navigate normally
|
|
if (clickedLink) return;
|
|
|
|
// Close any other open tooltips across the calendar
|
|
document.querySelectorAll('.appointment-block.open').forEach(function(block) {
|
|
if (block !== clickedBlock) {
|
|
block.classList.remove('open');
|
|
}
|
|
});
|
|
|
|
// Toggle the clicked appointment block's tooltip
|
|
if (clickedBlock) {
|
|
e.stopPropagation();
|
|
clickedBlock.classList.toggle('open');
|
|
}
|
|
});
|
|
}); |