Skip to content
Permalink
Browse files

Merge branch 't/11331b'

  • Loading branch information
mlewand committed Jan 14, 2014
2 parents 1794d46 + d7bf581 commit 1bc859e08d3b72098f01d4986e332d02597fa12f
Showing with 25 additions and 3 deletions.
  1. +2 −0 CHANGES.md
  2. +4 −0 dev/langtool/meta/ckeditor.plugin-button/meta.txt
  3. +8 −0 plugins/button/lang/en.js
  4. +11 −3 plugins/button/plugin.js
@@ -3,6 +3,8 @@ CKEditor 4 Changelog

## CKEditor 4.3.2


* [#11331](http://dev.ckeditor.com/ticket/11331): A11y menubutton will have changed label when selected, instead of `aria-pressed` attribute.
* [#11177](http://dev.ckeditor.com/ticket/11177): Widget's drag handler improvements:
* fixed: initial position is not updated when widget's data object is empty ([#11161](http://dev.ckeditor.com/ticket/11161)),
* fixed: multiple synchronous layout recalculations are caused by initial drag handler positioning causing performance issues ([#11001](http://dev.ckeditor.com/ticket/11001)),
@@ -0,0 +1,4 @@
# Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
# For licensing, see LICENSE.md or http://ckeditor.com/license

selectedLabel = Suffix added to menubutton label for screen readers, whenever button is marked as enabled.
@@ -0,0 +1,8 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/

CKEDITOR.plugins.setLang( 'button', 'en', {
selectedLabel: '%1 (Selected)'
} );
@@ -48,6 +48,7 @@
btnTpl = CKEDITOR.addTemplate( 'button', template );

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

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

return true;
} else

0 comments on commit 1bc859e

Please sign in to comment.
You can’t perform that action at this time.