Skip to content

Commit

Permalink
Close event popover when clicking outside it
Browse files Browse the repository at this point in the history
Also closes event popover on ESC key press.
  • Loading branch information
melissawm committed Jan 28, 2024
1 parent d6fa7d0 commit ebb9efc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/community/meeting_schedule.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,21 @@ If you are using napari or interested in how napari could be used in your work,
modal.style.display = "block";
var eventTitle = eventObj.title.charAt(0).toUpperCase() + eventObj.title.slice(1);
document.getElementById("details").innerHTML = '<b>' + eventTitle + '</b>' + '<br>' + eventObj.extendedProps.description;
//When the user clicks on <span> (x), close the modal
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
modal.onclick = function(event) {
if (event.target.id == "myModal") {
modal.style.display = "none";
}
}
window.addEventListener('keydown', function (event) {
if (event.key === 'Escape') {
modal.style.display = 'none'
}
})
},
eventDisplay: 'block',
});
Expand Down

0 comments on commit ebb9efc

Please sign in to comment.