Index: /CKEditor/branches/features/aria/_source/plugins/dialog/plugin.js =================================================================== --- /CKEditor/branches/features/aria/_source/plugins/dialog/plugin.js (revision 4925) +++ /CKEditor/branches/features/aria/_source/plugins/dialog/plugin.js (revision 4926) @@ -333,4 +333,12 @@ processed = 1; } + else if ( ( keystroke == 13 || keystroke == 32 ) && me._.tabBarMode ) + { + this.selectPage( this._.currentTabId ); + this._.tabBarMode = false; + this._.currentFocusIndex = -1; + changeFocus( true ); + processed =1; + } if ( processed ) @@ -346,12 +354,13 @@ } + var dialogElement = this._.element; // Add the dialog keyboard handlers. this.on( 'show', function() { - CKEDITOR.document.on( 'keydown', focusKeydownHandler, this, null, 0 ); + dialogElement.on( 'keydown', focusKeydownHandler, this, null, 0 ); // Some browsers instead, don't cancel key events in the keydown, but in the // keypress. So we must do a longer trip in those cases. (#4531) if ( CKEDITOR.env.opera || ( CKEDITOR.env.gecko && CKEDITOR.env.mac ) ) - CKEDITOR.document.on( 'keypress', focusKeyPressHandler, this ); + dialogElement.on( 'keypress', focusKeyPressHandler, this ); if ( CKEDITOR.env.ie6Compat ) @@ -363,7 +372,7 @@ this.on( 'hide', function() { - CKEDITOR.document.removeListener( 'keydown', focusKeydownHandler ); + dialogElement.removeListener( 'keydown', focusKeydownHandler ); if ( CKEDITOR.env.opera || ( CKEDITOR.env.gecko && CKEDITOR.env.mac ) ) - CKEDITOR.document.removeListener( 'keypress', focusKeyPressHandler ); + dialogElement.removeListener( 'keypress', focusKeyPressHandler ); } ); this.on( 'iframeAdded', function( evt ) @@ -427,28 +436,4 @@ for ( var i = 0 ; i < definition.contents.length ; i++ ) this.addPage( definition.contents[i] ); - - var tabRegex = /cke_dialog_tab(\s|$|_)/, - tabOuterRegex = /cke_dialog_tab(\s|$)/; - this.parts['tabs'].on( 'click', function( evt ) - { - var target = evt.data.getTarget(), firstNode = target, id, page; - - // If we aren't inside a tab, bail out. - if ( !( tabRegex.test( target.$.className ) || target.getName() == 'a' ) ) - return; - - // Find the outer