File tree Expand file tree Collapse file tree 5 files changed +25
-32
lines changed Expand file tree Collapse file tree 5 files changed +25
-32
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ CKEDITOR.plugins.add( 'colorbutton', {
32
32
label : title ,
33
33
title : title ,
34
34
modes : { wysiwyg :1 } ,
35
- editorFocus : 1 ,
35
+ editorFocus : 0 ,
36
36
toolbar : 'colors,' + order ,
37
37
allowedContent : style ,
38
38
requiredContent : style ,
Original file line number Diff line number Diff line change @@ -363,11 +363,19 @@ CKEDITOR.plugins.add( 'floatpanel', {
363
363
364
364
panel . isLoaded ? panelLoad ( ) : panel . onLoad = panelLoad ;
365
365
366
- // Set the panel frame focus, so the blur event gets fired.
367
366
CKEDITOR . tools . setTimeout ( function ( ) {
367
+ var scrollTop = CKEDITOR . env . webkit && CKEDITOR . document . getWindow ( ) . getScrollPosition ( ) . y ;
368
368
369
+ // Focus the panel frame first, so blur gets fired.
369
370
this . focus ( ) ;
370
371
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
+
371
379
// We need this get fired manually because of unfired focus() function.
372
380
this . allowBlur ( true ) ;
373
381
this . _ . editor . fire ( 'panelShow' , this ) ;
@@ -377,7 +385,6 @@ CKEDITOR.plugins.add( 'floatpanel', {
377
385
378
386
if ( this . onShow )
379
387
this . onShow . call ( this ) ;
380
-
381
388
} ,
382
389
383
390
/**
Original file line number Diff line number Diff line change @@ -223,16 +223,9 @@ CKEDITOR.plugins.add( 'listblock', {
223
223
}
224
224
}
225
225
}
226
- else {
227
- var scrollTop = CKEDITOR . document . getWindow ( ) . getScrollPosition ( ) . y ;
228
-
226
+ else
229
227
this . element . focus ( ) ;
230
228
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
-
236
229
selected && setTimeout ( function ( ) {
237
230
selected . focus ( ) ;
238
231
} , 0 ) ;
Original file line number Diff line number Diff line change 222
222
var holder = ! this . forceIFrame || CKEDITOR . env . ie ? this . _ . holder : this . document . getById ( this . id + '_frame' ) ;
223
223
224
224
if ( current ) {
225
- // Clean up the current block's effects on holder.
226
- holder . removeAttributes ( current . attributes ) ;
227
225
current . hide ( ) ;
228
226
}
229
227
230
228
this . _ . currentBlock = block ;
231
229
232
- holder . setAttributes ( block . attributes ) ;
233
230
CKEDITOR . fire ( 'ariaWidget' , holder ) ;
234
231
235
232
// Reset the focus index, so it will always go into the first one.
265
262
$ : function ( blockHolder , blockDefinition ) {
266
263
this . element = blockHolder . append ( blockHolder . getDocument ( ) . createElement ( 'div' , {
267
264
attributes : {
268
- 'tabIndex' : - 1 ,
269
- 'class' : 'cke_panel_block' ,
270
- 'role' : 'presentation' ,
271
- 'tabindex' : 0
265
+ 'tabindex' : - 1 ,
266
+ 'class' : 'cke_panel_block'
272
267
} ,
273
268
styles : {
274
269
display : 'none'
279
274
if ( blockDefinition )
280
275
CKEDITOR . tools . extend ( this , blockDefinition ) ;
281
276
282
-
283
277
// Set the a11y attributes of this element ...
284
278
this . element . setAttributes ( {
279
+ 'role' : this . attributes . role || 'presentation' ,
285
280
'aria-label' : this . attributes [ 'aria-label' ] ,
286
281
'title' : this . attributes . title || this . attributes [ 'aria-label' ]
287
282
} ) ;
288
283
289
- // ... and remove them from being set in the panel main element.
290
- delete this . attributes [ 'aria-label' ] ;
291
- delete this . attributes . title ;
292
-
293
284
this . keys = { } ;
294
285
295
286
this . _ . focusIndex = - 1 ;
Original file line number Diff line number Diff line change @@ -119,13 +119,11 @@ CKEDITOR.plugins.add( 'richcombo', {
119
119
120
120
var id = 'cke_' + this . id ;
121
121
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
+ }
129
127
instance . execute ( el ) ;
130
128
} , this ) ;
131
129
@@ -251,12 +249,16 @@ CKEDITOR.plugins.add( 'richcombo', {
251
249
252
250
me . _ . on = 1 ;
253
251
254
- me . editorFocus && editor . focus ( ) ;
252
+ me . editorFocus && ! editor . focusManager . hasFocus && editor . focus ( ) ;
255
253
256
254
if ( me . onOpen )
257
255
me . onOpen ( ) ;
258
256
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
+ } ) ;
260
262
} ;
261
263
262
264
panel . onHide = function ( preventOnClose ) {
You can’t perform that action at this time.
0 commit comments