Skip to content

Commit ec71357

Browse files
committed
Merge branch 't/10951'
2 parents d2add24 + 1c06038 commit ec71357

File tree

5 files changed

+25
-32
lines changed

5 files changed

+25
-32
lines changed

plugins/colorbutton/plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ CKEDITOR.plugins.add( 'colorbutton', {
3232
label: title,
3333
title: title,
3434
modes: { wysiwyg:1 },
35-
editorFocus: 1,
35+
editorFocus: 0,
3636
toolbar: 'colors,' + order,
3737
allowedContent: style,
3838
requiredContent: style,

plugins/floatpanel/plugin.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,19 @@ CKEDITOR.plugins.add( 'floatpanel', {
363363

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

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

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

372+
// Focus the block now.
373+
block.element.focus();
374+
375+
// #10623, #10951 - restore the viewport's scroll position after focusing list element.
376+
if ( CKEDITOR.env.webkit )
377+
CKEDITOR.document.getBody().$.scrollTop = scrollTop;
378+
371379
// We need this get fired manually because of unfired focus() function.
372380
this.allowBlur( true );
373381
this._.editor.fire( 'panelShow', this );
@@ -377,7 +385,6 @@ CKEDITOR.plugins.add( 'floatpanel', {
377385

378386
if ( this.onShow )
379387
this.onShow.call( this );
380-
381388
},
382389

383390
/**

plugins/listblock/plugin.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,9 @@ CKEDITOR.plugins.add( 'listblock', {
223223
}
224224
}
225225
}
226-
else {
227-
var scrollTop = CKEDITOR.document.getWindow().getScrollPosition().y;
228-
226+
else
229227
this.element.focus();
230228

231-
// #10623 - restore the viewport's scroll position after focusing list element.
232-
if ( CKEDITOR.env.webkit )
233-
CKEDITOR.document[ CKEDITOR.env.webkit ? 'getBody' : 'getDocumentElement' ]().$.scrollTop = scrollTop;
234-
}
235-
236229
selected && setTimeout( function() {
237230
selected.focus();
238231
}, 0 );

plugins/panel/plugin.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,11 @@
222222
var holder = !this.forceIFrame || CKEDITOR.env.ie ? this._.holder : this.document.getById( this.id + '_frame' );
223223

224224
if ( current ) {
225-
// Clean up the current block's effects on holder.
226-
holder.removeAttributes( current.attributes );
227225
current.hide();
228226
}
229227

230228
this._.currentBlock = block;
231229

232-
holder.setAttributes( block.attributes );
233230
CKEDITOR.fire( 'ariaWidget', holder );
234231

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

282-
283277
// Set the a11y attributes of this element ...
284278
this.element.setAttributes( {
279+
'role': this.attributes.role || 'presentation',
285280
'aria-label': this.attributes[ 'aria-label' ],
286281
'title': this.attributes.title || this.attributes[ 'aria-label' ]
287282
} );
288283

289-
// ... and remove them from being set in the panel main element.
290-
delete this.attributes[ 'aria-label' ];
291-
delete this.attributes.title;
292-
293284
this.keys = {};
294285

295286
this._.focusIndex = -1;

plugins/richcombo/plugin.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,11 @@ CKEDITOR.plugins.add( 'richcombo', {
119119

120120
var id = 'cke_' + this.id;
121121
var clickFn = CKEDITOR.tools.addFunction( function( el ) {
122-
123-
// Restore locked selection in Opera.
124-
if ( selLocked ) {
125-
editor.unlockSelection( 1 );
126-
selLocked = 0;
127-
}
128-
122+
// Restore locked selection in Opera.
123+
if ( selLocked ) {
124+
editor.unlockSelection( 1 );
125+
selLocked = 0;
126+
}
129127
instance.execute( el );
130128
}, this );
131129

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

252250
me._.on = 1;
253251

254-
me.editorFocus && editor.focus();
252+
me.editorFocus && !editor.focusManager.hasFocus && editor.focus();
255253

256254
if ( me.onOpen )
257255
me.onOpen();
258256

259-
list.focus( !list.multiSelect && me.getValue() );
257+
// The "panelShow" event is fired assinchronously, after the
258+
// onShow method call.
259+
editor.once( 'panelShow', function() {
260+
list.focus( !list.multiSelect && me.getValue() );
261+
} );
260262
};
261263

262264
panel.onHide = function( preventOnClose ) {

0 commit comments

Comments
 (0)