diff --git a/crouton.php b/crouton.php index fd69548..973a9c5 100644 --- a/crouton.php +++ b/crouton.php @@ -5,7 +5,7 @@ Description: A tabbed based display for showing meeting information. Author: bmlt-enabled Author URI: https://bmlt.app -Version: 3.18.10 +Version: 3.18.11 */ /* Disallow direct access to the plugin file */ if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) { diff --git a/croutonjs/meetingMap/js/meeting_map.js b/croutonjs/meetingMap/js/meeting_map.js index bdfd3cb..9233a69 100644 --- a/croutonjs/meetingMap/js/meeting_map.js +++ b/croutonjs/meetingMap/js/meeting_map.js @@ -297,6 +297,7 @@ function MeetingMap(inConfig) { var g_suspendedFullscreen = false; function closeModalWindow(modal) { gDelegate.modalOff(); + activeModal = null; if (!modal.classList.contains("modal")) return closeModalWindow(modal.parentNode); modal.style.display = "none"; @@ -307,12 +308,20 @@ function MeetingMap(inConfig) { } } } + var activeModal = null; + document.addEventListener("keydown", function(event) { + if (activeModal && event.key == "Escape") { + closeModalWindow(activeModal); + } + }, true); function openModalWindow(modal) { if (isFullscreen()) { g_suspendedFullscreen = true; toggleFullscreen(); } modal.style.display = "block"; + modal.focus(); + activeModal = modal; dd = document.getElementById("map-menu-dropdown"); if (dd) dd.style.display = "none"; gDelegate.modalOn(); diff --git a/croutonjs/src/js/crouton-default-templates.js b/croutonjs/src/js/crouton-default-templates.js index d6fadc8..1311477 100644 --- a/croutonjs/src/js/crouton-default-templates.js +++ b/croutonjs/src/js/crouton-default-templates.js @@ -36,7 +36,7 @@ var croutonDefaultTemplates = { "{{#isNotTemporarilyClosed this}}", " {{#unless (hasFormats 'VM' this)}}", "