Skip to content
Permalink
Browse files

Merge branch 't/11075'

  • Loading branch information...
mlewand committed Dec 4, 2013
2 parents a0080c0 + 68bcf48 commit 430ada97f338a84c337ccd3c7043549b26ddfa05
Showing with 25 additions and 10 deletions.
  1. +5 −1 plugins/richcombo/plugin.js
  2. +20 −9 plugins/toolbar/plugin.js
@@ -185,9 +185,13 @@ CKEDITOR.plugins.add( 'richcombo', {

var keystroke = ev.getKeystroke();
switch ( keystroke ) {
case 40: // ARROW-DOWN
// This call is duplicated in plugins\toolbar\plugin.js in itemKeystroke().
editor.once( 'panelShow', function( evt ) {
evt.data._.panel._.currentBlock.onKeyDown( 40 );
} );
case 13: // ENTER
case 32: // SPACE
case 40: // ARROW-DOWN
// Show panel
CKEDITOR.tools.callFunction( clickFn, element );
break;
@@ -57,7 +57,10 @@
var itemKeystroke = function( item, keystroke ) {
var next, toolbar;
var rtl = editor.lang.dir == 'rtl',
toolbarGroupCycling = editor.config.toolbarGroupCycling;
toolbarGroupCycling = editor.config.toolbarGroupCycling,
// Picking right/left key codes.
rightKeyCode = rtl ? 37 : 39,
leftKeyCode = rtl ? 39 : 37;

toolbarGroupCycling = toolbarGroupCycling === undefined || toolbarGroupCycling;

@@ -86,9 +89,7 @@

return false;

case rtl ? 37:
39 : // RIGHT-ARROW
case 40: // DOWN-ARROW
case rightKeyCode:
next = item;
do {
// Look for the next item in the toolbar.
@@ -97,7 +98,7 @@
// If it's the last item, cycle to the first one.
if ( !next && toolbarGroupCycling ) next = item.toolbar.items[ 0 ];
}
while ( next && !next.focus )
while ( next && !next.focus );

// If available, just focus it, otherwise focus the
// first one.
@@ -108,9 +109,19 @@
itemKeystroke( item, 9 );

return false;

case rtl ? 39:
37 : // LEFT-ARROW
case 40: // DOWN-ARROW
if ( item.button && item.button.hasArrow ) {
// Note: code is duplicated in plugins\richcombo\plugin.js in keyDownFn().
editor.once( 'panelShow', function( evt ) {
evt.data._.panel._.currentBlock.onKeyDown( 40 );
} );
item.execute();
} else {
// Send left arrow key.
itemKeystroke( item, keystroke == 40 ? rightKeyCode : leftKeyCode );
}
return false;
case leftKeyCode:
case 38: // UP-ARROW
next = item;
do {
@@ -120,7 +131,7 @@
// If it's the first item, cycle to the last one.
if ( !next && toolbarGroupCycling ) next = item.toolbar.items[ item.toolbar.items.length - 1 ];
}
while ( next && !next.focus )
while ( next && !next.focus );

// If available, just focus it, otherwise focus the
// last one.

0 comments on commit 430ada9

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