diff --git a/core/modules/overlay/css/overlay-child.css b/core/modules/overlay/css/overlay-child.css index b40e3af97ddf65ea695ca2e6b5ea1fb1e8962e62..6efd7be13402dfde696fa09b2dc00d2e82e45944 100644 --- a/core/modules/overlay/css/overlay-child.css +++ b/core/modules/overlay/css/overlay-child.css @@ -78,6 +78,7 @@ html[dir="rtl"] { #overlay-close, #overlay-close:hover { background: #ffffff url(../images/close.png) no-repeat; + border: 0; border-radius: 0 12px 12px 0; /* LTR */ display: block; height: 26px; @@ -91,6 +92,9 @@ html[dir="rtl"] { [dir="rtl"] #overlay-close:hover { border-radius: 12px 0 0 12px; } +#overlay-close:focus, #overlay-close:active{ + outline: 1px dotted; +} /** * Tabs on the overlay. diff --git a/core/modules/overlay/overlay-parent.js b/core/modules/overlay/overlay-parent.js index ae1d5b8f468da3ffa92d0ac09d5930fd18098535..0e5fcf06404e7aa9e55b7beac0d0cfaa0c0189ec 100644 --- a/core/modules/overlay/overlay-parent.js +++ b/core/modules/overlay/overlay-parent.js @@ -516,6 +516,13 @@ Drupal.overlay.eventhandlerOverrideLink = function (event) { var $target = $(event.target); + // Close the overlay when the button contains the overlay-close class. + if ($target.is('button') && $target.hasClass('overlay-close')) { + // Clearing the overlay URL fragment will close the overlay. + $.bbq.removeState('overlay'); + return; + } + // Only continue if clicked target (or one of its parents) is a link. if (!$target.is('a')) { $target = $target.closest('a'); @@ -529,13 +536,6 @@ Drupal.overlay.eventhandlerOverrideLink = function (event) { return; } - // Close the overlay when the link contains the overlay-close class. - if ($target.hasClass('overlay-close')) { - // Clearing the overlay URL fragment will close the overlay. - $.bbq.removeState('overlay'); - return; - } - var target = $target[0]; var href = target.href; // Only handle links that have an href attribute and use the HTTP(S) protocol. diff --git a/core/modules/overlay/templates/overlay.html.twig b/core/modules/overlay/templates/overlay.html.twig index 732bc33737ad1097dd858c2ccb4d91527a1c4cd4..57605cd55675f25cb47da0d4d84f097e1d7bec55 100644 --- a/core/modules/overlay/templates/overlay.html.twig +++ b/core/modules/overlay/templates/overlay.html.twig @@ -25,7 +25,7 @@