Skip to content
Permalink
Browse files

Merge branch 't/10951'

  • Loading branch information...
fredck committed Oct 7, 2013
2 parents d2add24 + 1c06038 commit ec713572da273bc3ccc25d74bb0aae8c820c34f9
@@ -32,7 +32,7 @@ CKEDITOR.plugins.add( 'colorbutton', {
label: title,
title: title,
modes: { wysiwyg:1 },
editorFocus: 1,
editorFocus: 0,
toolbar: 'colors,' + order,
allowedContent: style,
requiredContent: style,
@@ -363,11 +363,19 @@ CKEDITOR.plugins.add( 'floatpanel', {

panel.isLoaded ? panelLoad() : panel.onLoad = panelLoad;

// Set the panel frame focus, so the blur event gets fired.
CKEDITOR.tools.setTimeout( function() {
var scrollTop = CKEDITOR.env.webkit && CKEDITOR.document.getWindow().getScrollPosition().y;

// Focus the panel frame first, so blur gets fired.
this.focus();

// Focus the block now.
block.element.focus();

// #10623, #10951 - restore the viewport's scroll position after focusing list element.
if ( CKEDITOR.env.webkit )
CKEDITOR.document.getBody().$.scrollTop = scrollTop;

// We need this get fired manually because of unfired focus() function.
this.allowBlur( true );
this._.editor.fire( 'panelShow', this );
@@ -377,7 +385,6 @@ CKEDITOR.plugins.add( 'floatpanel', {

if ( this.onShow )
this.onShow.call( this );

},

/**
@@ -223,16 +223,9 @@ CKEDITOR.plugins.add( 'listblock', {
}
}
}
else {
var scrollTop = CKEDITOR.document.getWindow().getScrollPosition().y;

else
this.element.focus();

// #10623 - restore the viewport's scroll position after focusing list element.
if ( CKEDITOR.env.webkit )
CKEDITOR.document[ CKEDITOR.env.webkit ? 'getBody' : 'getDocumentElement' ]().$.scrollTop = scrollTop;
}

selected && setTimeout( function() {
selected.focus();
}, 0 );
@@ -222,14 +222,11 @@
var holder = !this.forceIFrame || CKEDITOR.env.ie ? this._.holder : this.document.getById( this.id + '_frame' );

if ( current ) {
// Clean up the current block's effects on holder.
holder.removeAttributes( current.attributes );
current.hide();
}

this._.currentBlock = block;

holder.setAttributes( block.attributes );
CKEDITOR.fire( 'ariaWidget', holder );

// Reset the focus index, so it will always go into the first one.
@@ -265,10 +262,8 @@
$: function( blockHolder, blockDefinition ) {
this.element = blockHolder.append( blockHolder.getDocument().createElement( 'div', {
attributes: {
'tabIndex': -1,
'class': 'cke_panel_block',
'role': 'presentation',
'tabindex': 0
'tabindex': -1,
'class': 'cke_panel_block'
},
styles: {
display: 'none'
@@ -279,17 +274,13 @@
if ( blockDefinition )
CKEDITOR.tools.extend( this, blockDefinition );


// Set the a11y attributes of this element ...
this.element.setAttributes( {
'role': this.attributes.role || 'presentation',
'aria-label': this.attributes[ 'aria-label' ],
'title': this.attributes.title || this.attributes[ 'aria-label' ]
} );

// ... and remove them from being set in the panel main element.
delete this.attributes[ 'aria-label' ];
delete this.attributes.title;

this.keys = {};

this._.focusIndex = -1;
@@ -119,13 +119,11 @@ CKEDITOR.plugins.add( 'richcombo', {

var id = 'cke_' + this.id;
var clickFn = CKEDITOR.tools.addFunction( function( el ) {

// Restore locked selection in Opera.
if ( selLocked ) {
editor.unlockSelection( 1 );
selLocked = 0;
}

// Restore locked selection in Opera.
if ( selLocked ) {
editor.unlockSelection( 1 );
selLocked = 0;
}
instance.execute( el );
}, this );

@@ -251,12 +249,16 @@ CKEDITOR.plugins.add( 'richcombo', {

me._.on = 1;

me.editorFocus && editor.focus();
me.editorFocus && !editor.focusManager.hasFocus && editor.focus();

if ( me.onOpen )
me.onOpen();

list.focus( !list.multiSelect && me.getValue() );
// The "panelShow" event is fired assinchronously, after the
// onShow method call.
editor.once( 'panelShow', function() {
list.focus( !list.multiSelect && me.getValue() );
} );
};

panel.onHide = function( preventOnClose ) {

0 comments on commit ec71357

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