summaryrefslogtreecommitdiffstats
path: root/wp-includes/js/admin-bar.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
commit30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch)
tree39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-includes/js/admin-bar.js
parentAdding upstream version 6.4.3+dfsg1. (diff)
downloadwordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz
wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip
Adding upstream version 6.5+dfsg1.upstream/6.5+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/js/admin-bar.js')
-rw-r--r--wp-includes/js/admin-bar.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/wp-includes/js/admin-bar.js b/wp-includes/js/admin-bar.js
index 8cb94ea..01b175d 100644
--- a/wp-includes/js/admin-bar.js
+++ b/wp-includes/js/admin-bar.js
@@ -31,7 +31,7 @@
topMenuItems = adminBar.querySelectorAll( 'li.menupop' );
allMenuItems = adminBar.querySelectorAll( '.ab-item' );
- adminBarLogout = document.getElementById( 'wp-admin-bar-logout' );
+ adminBarLogout = document.querySelector( '#wp-admin-bar-logout a' );
adminBarSearchForm = document.getElementById( 'adminbarsearch' );
shortlink = document.getElementById( 'wp-admin-bar-get-shortlink' );
skipLink = adminBar.querySelector( '.screen-reader-shortcut' );
@@ -149,7 +149,8 @@
function toggleHoverIfEnter( event ) {
var wrapper;
- if ( event.which !== 13 ) {
+ // Follow link if pressing Ctrl and/or Shift with Enter (opening in a new tab or window).
+ if ( event.which !== 13 || event.ctrlKey || event.shiftKey ) {
return;
}
@@ -336,6 +337,11 @@
element.className += className;
}
+
+ var menuItemToggle = element.querySelector( 'a' );
+ if ( className === 'hover' && menuItemToggle && menuItemToggle.hasAttribute( 'aria-expanded' ) ) {
+ menuItemToggle.setAttribute( 'aria-expanded', 'true' );
+ }
}
/**
@@ -366,6 +372,11 @@
element.className = classes.replace( /^[\s]+|[\s]+$/g, '' );
}
+
+ var menuItemToggle = element.querySelector( 'a' );
+ if ( className === 'hover' && menuItemToggle && menuItemToggle.hasAttribute( 'aria-expanded' ) ) {
+ menuItemToggle.setAttribute( 'aria-expanded', 'false' );
+ }
}
/**