mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
MWTransclusionDialog: Set 'aria-expanded' on "Show/hide options" button
Adding the ability for screen reader to announce the state of the Transclusion dialog when the show/hide options button is clicked. Bug: T248089 Change-Id: I89b86179bcb63376e480cb8df55e24b9d29df037
This commit is contained in:
parent
cae5f665b8
commit
2aeae1c3f9
|
@ -256,11 +256,16 @@ ve.ui.MWTransclusionDialog.prototype.updateModeActionState = function () {
|
|||
var parts = this.transclusionModel && this.transclusionModel.getParts(),
|
||||
mode = this.mode;
|
||||
this.actions.forEach( { actions: [ 'mode' ] }, function ( action ) {
|
||||
action.setLabel(
|
||||
mode === 'single' ?
|
||||
ve.msg( 'visualeditor-dialog-transclusion-multiple-mode' ) :
|
||||
ve.msg( 'visualeditor-dialog-transclusion-single-mode' )
|
||||
);
|
||||
var label, expanded;
|
||||
if ( mode === 'single' ) {
|
||||
label = ve.msg( 'visualeditor-dialog-transclusion-multiple-mode' );
|
||||
expanded = false;
|
||||
} else {
|
||||
label = ve.msg( 'visualeditor-dialog-transclusion-single-mode' );
|
||||
expanded = true;
|
||||
}
|
||||
action.setLabel( label );
|
||||
action.$button.attr( 'aria-expanded', expanded.toString() );
|
||||
} );
|
||||
|
||||
// Decide whether the button should be enabled or not. It needs to be:
|
||||
|
|
Loading…
Reference in a new issue