Skip to content

Commit 1bc859e

Browse files
committed
Merge branch 't/11331b'
2 parents 1794d46 + d7bf581 commit 1bc859e

4 files changed

Lines changed: 25 additions & 3 deletions

File tree

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ CKEditor 4 Changelog
33

44
## CKEditor 4.3.2
55

6+
7+
* [#11331](http://dev.ckeditor.com/ticket/11331): A11y menubutton will have changed label when selected, instead of `aria-pressed` attribute.
68
* [#11177](http://dev.ckeditor.com/ticket/11177): Widget's drag handler improvements:
79
* fixed: initial position is not updated when widget's data object is empty ([#11161](http://dev.ckeditor.com/ticket/11161)),
810
* fixed: multiple synchronous layout recalculations are caused by initial drag handler positioning causing performance issues ([#11001](http://dev.ckeditor.com/ticket/11001)),
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
2+
# For licensing, see LICENSE.md or http://ckeditor.com/license
3+
4+
selectedLabel = Suffix added to menubutton label for screen readers, whenever button is marked as enabled.

plugins/button/lang/en.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
3+
* For licensing, see LICENSE.md or http://ckeditor.com/license
4+
*/
5+
6+
CKEDITOR.plugins.setLang( 'button', 'en', {
7+
selectedLabel: '%1 (Selected)'
8+
} );

plugins/button/plugin.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
btnTpl = CKEDITOR.addTemplate( 'button', template );
4949

5050
CKEDITOR.plugins.add( 'button', {
51+
lang: 'en', // %REMOVE_LINE_CORE%
5152
beforeInit: function( editor ) {
5253
editor.ui.addHandler( CKEDITOR.UI_BUTTON, CKEDITOR.ui.button.handler );
5354
}
@@ -307,9 +308,16 @@
307308
element.setAttribute( 'aria-disabled', true ) :
308309
element.removeAttribute( 'aria-disabled' );
309310

310-
state == CKEDITOR.TRISTATE_ON ?
311-
element.setAttribute( 'aria-pressed', true ) :
312-
element.removeAttribute( 'aria-pressed' );
311+
if ( !this.hasArrow ) {
312+
// Note: aria-pressed attribute should not be added to menuButton instances. (#11331)
313+
state == CKEDITOR.TRISTATE_ON ?
314+
element.setAttribute( 'aria-pressed', true ) :
315+
element.removeAttribute( 'aria-pressed' );
316+
} else {
317+
var newLabel = state == CKEDITOR.TRISTATE_ON ?
318+
this._.editor.lang.button.selectedLabel.replace( /%1/g, this.label ) : this.label;
319+
CKEDITOR.document.getById( this._.id + '_label' ).setText( newLabel );
320+
}
313321

314322
return true;
315323
} else

0 commit comments

Comments
 (0)