mirror of
https://github.com/flarum/core.git
synced 2025-08-04 15:37:51 +02:00
Add 'Close' & 'Back' aria-label attributes to buttons. (#3161)
* Add aria-label attributes to close buttons in nav, welcome hero, modal close. * Replace title with aria-label in nav back button.
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import app from '../../common/app';
|
||||||
import Component from '../Component';
|
import Component from '../Component';
|
||||||
import Alert, { AlertAttrs } from './Alert';
|
import Alert, { AlertAttrs } from './Alert';
|
||||||
import Button from './Button';
|
import Button from './Button';
|
||||||
@@ -91,6 +92,7 @@ export default abstract class Modal<ModalAttrs = {}> extends Component<ModalAttr
|
|||||||
icon: 'fas fa-times',
|
icon: 'fas fa-times',
|
||||||
onclick: this.hide.bind(this),
|
onclick: this.hide.bind(this),
|
||||||
className: 'Button Button--icon Button--link',
|
className: 'Button Button--icon Button--link',
|
||||||
|
'aria-label': app.translator.trans('core.lib.modal.close'),
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
@@ -47,7 +47,7 @@ export default class Navigation extends Component {
|
|||||||
className: 'Button Navigation-back Button--icon',
|
className: 'Button Navigation-back Button--icon',
|
||||||
href: history.backUrl(),
|
href: history.backUrl(),
|
||||||
icon: 'fas fa-chevron-left',
|
icon: 'fas fa-chevron-left',
|
||||||
title: previous.title,
|
'aria-label': previous.title,
|
||||||
onclick: (e) => {
|
onclick: (e) => {
|
||||||
if (e.shiftKey || e.ctrlKey || e.metaKey || e.which === 2) return;
|
if (e.shiftKey || e.ctrlKey || e.metaKey || e.which === 2) return;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@@ -27,6 +27,7 @@ export default class WelcomeHero extends Component {
|
|||||||
icon: 'fas fa-times',
|
icon: 'fas fa-times',
|
||||||
onclick: slideUp,
|
onclick: slideUp,
|
||||||
className: 'Hero-close Button Button--icon Button--link',
|
className: 'Hero-close Button Button--icon Button--link',
|
||||||
|
'aria-label': app.translator.trans('core.forum.welcome_hero.hide'),
|
||||||
})}
|
})}
|
||||||
|
|
||||||
<div className="containerNarrow">
|
<div className="containerNarrow">
|
||||||
|
@@ -497,6 +497,9 @@ core:
|
|||||||
resend_button: Resend Confirmation Email
|
resend_button: Resend Confirmation Email
|
||||||
sent_message: Sent
|
sent_message: Sent
|
||||||
|
|
||||||
|
welcome_hero:
|
||||||
|
hide: Hide welcome message
|
||||||
|
|
||||||
# Translations in this namespace are used by the forum and admin interfaces.
|
# Translations in this namespace are used by the forum and admin interfaces.
|
||||||
lib:
|
lib:
|
||||||
debug_button: Debug
|
debug_button: Debug
|
||||||
@@ -539,6 +542,10 @@ core:
|
|||||||
loading_indicator:
|
loading_indicator:
|
||||||
accessible_label: => core.ref.loading
|
accessible_label: => core.ref.loading
|
||||||
|
|
||||||
|
# These translations are used in modals.
|
||||||
|
modal:
|
||||||
|
close: Close
|
||||||
|
|
||||||
# These translations are used in the navigation header.
|
# These translations are used in the navigation header.
|
||||||
nav:
|
nav:
|
||||||
drawer_button: Open Navigation Drawer
|
drawer_button: Open Navigation Drawer
|
||||||
|
Reference in New Issue
Block a user