@bmlt-enabled/croutonjs 3.18.9 → 3.18.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/crouton-map.js CHANGED
@@ -297,6 +297,7 @@ function MeetingMap(inConfig) {
297
297
  var g_suspendedFullscreen = false;
298
298
  function closeModalWindow(modal) {
299
299
  gDelegate.modalOff();
300
+ activeModal = null;
300
301
  if (!modal.classList.contains("modal"))
301
302
  return closeModalWindow(modal.parentNode);
302
303
  modal.style.display = "none";
@@ -307,12 +308,20 @@ function MeetingMap(inConfig) {
307
308
  }
308
309
  }
309
310
  }
311
+ var activeModal = null;
312
+ document.addEventListener("keydown", function(event) {
313
+ if (activeModal && event.key == "Escape") {
314
+ closeModalWindow(activeModal);
315
+ }
316
+ }, true);
310
317
  function openModalWindow(modal) {
311
318
  if (isFullscreen()) {
312
319
  g_suspendedFullscreen = true;
313
320
  toggleFullscreen();
314
321
  }
315
322
  modal.style.display = "block";
323
+ modal.focus();
324
+ activeModal = modal;
316
325
  dd = document.getElementById("map-menu-dropdown");
317
326
  if (dd) dd.style.display = "none";
318
327
  gDelegate.modalOn();