Use <a> instead of <a href="#"> for JavaScript click events
* No status line with URL and "#". * No new tab on middle click. tabindex="0" ensures to have the normal tab order. role="button" according to https://www.mediawiki.org/wiki/Accessibility_guide_for_developers Change-Id: I82f1923b3905f111ce7719c03a3919633271720a
This commit is contained in:
@@ -387,7 +387,7 @@ class UniversalLanguageSelectorHooks {
|
||||
'section' => 'personal/i18n',
|
||||
// We use this class to hide this from no-JS users
|
||||
'cssclass' => 'uls-preferences-link-wrapper',
|
||||
'default' => "<a id='uls-preferences-link' href='#'>" .
|
||||
'default' => "<a id='uls-preferences-link' role='button' tabindex='0'>" .
|
||||
wfMessage( 'ext-uls-language-settings-preferences-link' )->escaped() . "</a>",
|
||||
];
|
||||
|
||||
|
||||
@@ -382,10 +382,15 @@
|
||||
|
||||
// Bind language settings to preferences page link
|
||||
$( '#uls-preferences-link' )
|
||||
.click( function () {
|
||||
.on( 'click keypress', function ( e ) {
|
||||
if (
|
||||
e.type === 'click' ||
|
||||
e.type === 'keypress' && e.which === 13
|
||||
) {
|
||||
$ulsTrigger.trigger( 'click', {
|
||||
source: 'preferences'
|
||||
} );
|
||||
}
|
||||
|
||||
return false;
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user