mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 23:58:03 +00:00
Accessibility: Change the "Show details" links in the update core screen to buttons.
These controls toggle the visibility of the update progress: they perform an action therefore they should be buttons. Also: - uses `aria-expanded` to communicate the toggle button state - removes some inline JavaScript - when clicking the toggle buttons, the progress details get moved with JavaScript after the button: this helps users of assistive technologies in finding them and makes the UI a bit more intuitive Props Cheffheid, afercia. See #26504. Fixes #40453. git-svn-id: https://develop.svn.wordpress.org/trunk@40646 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -978,6 +978,25 @@ $document.ready( function() {
|
||||
|
||||
// Set initial focus on a specific element.
|
||||
$( '.wp-initial-focus' ).focus();
|
||||
|
||||
// Toggle update details on update-core.php.
|
||||
$body.on( 'click', '.js-update-details-toggle', function() {
|
||||
var $updateNotice = $( this ).closest( '.js-update-details' ),
|
||||
$progressDiv = $( '#' + $updateNotice.data( 'update-details' ) );
|
||||
|
||||
/*
|
||||
* When clicking on "Show details" move the progress div below the update
|
||||
* notice. Make sure it gets moved just the first time.
|
||||
*/
|
||||
if ( ! $progressDiv.hasClass( 'update-details-moved' ) ) {
|
||||
$progressDiv.insertAfter( $updateNotice ).addClass( 'update-details-moved' );
|
||||
}
|
||||
|
||||
// Toggle the progress div visibility.
|
||||
$progressDiv.toggle();
|
||||
// Toggle the Show Details button expanded state.
|
||||
$( this ).attr( 'aria-expanded', $progressDiv.is( ':visible' ) )
|
||||
})
|
||||
});
|
||||
|
||||
// Fire a custom jQuery event at the end of window resize
|
||||
|
||||
Reference in New Issue
Block a user