From 501215e868dafaf5708e5d802ba960d889023ee9 Mon Sep 17 00:00:00 2001 From: otrok7 <50595291+otrok7@users.noreply.github.com> Date: Mon, 8 Apr 2024 23:30:28 +0200 Subject: [PATCH 1/3] accessibility --- croutonjs/meetingMap/js/meeting_map.js | 9 +++++++++ croutonjs/src/js/crouton-default-templates.js | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) 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..e3d9618 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)}}", "
", - " ", + " ", " ", " {{getWord 'meeting details'}}", " ", @@ -66,10 +66,10 @@ var croutonDefaultTemplates = { "{{/if}}" ].join('\n'), meeting_modal_template: [ - "{{this.meeting_name}}", + "{{this.meeting_name}}", ].join('\n'), meetingpage_frame_template: ` -