Skip to content

Commit

Permalink
Merge branch 't/11044'
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewand committed Dec 4, 2013
2 parents d555b5e + caac891 commit 16b11f4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CKEditor 4 Changelog

Fixed Issues:

* [#11044](http://dev.ckeditor.com/ticket/11044): Enhanced aria support for language plugin drop-down menu.
* [#11075](http://dev.ckeditor.com/ticket/11075): With drop-down menubutton focused, pressing down arrow key will now open menu and focus its first option.
* [#11165](http://dev.ckeditor.com/ticket/11165): The filebrowser plugin cannot be removed from the editor.
* [#11171](http://dev.ckeditor.com/ticket/11171): Fixed: [`editor.insertElement`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-insertElement) and [`editor.insertText`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-insertText) methods do not call the [`widget.repository.checkWidgets`](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.widget.repository-method-checkWidgets) method.
Expand Down
3 changes: 2 additions & 1 deletion plugins/language/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
ltr: ( '' + parts[ 2 ] ).toLowerCase() != 'rtl',
onClick: function() {
editor.execCommand( 'language', this.langId );
}
},
role: 'menuitemcheckbox'
};

// Init style property.
Expand Down
15 changes: 11 additions & 4 deletions plugins/menu/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ CKEDITOR.plugins.add( 'menu', {
' tabindex="-1"' +
'_cke_focus=1' +
' hidefocus="true"' +
' role="menuitem"' +
' role="{role}"' +
' aria-haspopup="{hasPopup}"' +
' aria-disabled="{disabled}"';
' aria-disabled="{disabled}"' +
' {ariaChecked}';

// Some browsers don't cancel key events in the keydown but in the
// keypress.
Expand Down Expand Up @@ -460,10 +461,14 @@ CKEDITOR.plugins.add( 'menu', {
proto: {
render: function( menu, index, output ) {
var id = menu.id + String( index ),
state = ( typeof this.state == 'undefined' ) ? CKEDITOR.TRISTATE_OFF : this.state;
state = ( typeof this.state == 'undefined' ) ? CKEDITOR.TRISTATE_OFF : this.state,
ariaChecked = '';

var stateName = state == CKEDITOR.TRISTATE_ON ? 'on' : state == CKEDITOR.TRISTATE_DISABLED ? 'disabled' : 'off';

if ( this.role in { menuitemcheckbox: 1, menuitemradio: 1 } )
ariaChecked = ' aria-checked="' + ( state == CKEDITOR.TRISTATE_ON ? 'true' : 'false' ) + '"';

var hasSubMenu = this.getItems;
// ltr: BLACK LEFT-POINTING POINTER
// rtl: BLACK RIGHT-POINTING POINTER
Expand All @@ -489,7 +494,9 @@ CKEDITOR.plugins.add( 'menu', {
clickFn: menu._.itemClickFn,
index: index,
iconStyle: CKEDITOR.skin.getIconStyle( iconName, ( this.editor.lang.dir == 'rtl' ), iconName == this.icon ? null : this.icon, this.iconOffset ),
arrowHtml: hasSubMenu ? menuArrowTpl.output({ label: arrowLabel } ) : ''
arrowHtml: hasSubMenu ? menuArrowTpl.output( { label : arrowLabel } ) : '',
role: this.role ? this.role : 'menuitem',
ariaChecked: ariaChecked
};

menuItemTpl.output( params, output );
Expand Down

0 comments on commit 16b11f4

Please sign in to comment.