Ticket #6247: 6247_2.patch

File 6247_2.patch, 2.5 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/richcombo/plugin.js

     
    255255                        panel.onEscape = function()
    256256                                {
    257257                                        panel.hide();
    258                                         me.document.getById( 'cke_' + me.id ).getFirst().getNext().focus();
    259258                                };
    260259
    261260                        list.onClick = function( value, marked )
  • _source/plugins/stylescombo/plugin.js

     
    9696
    9797                                                                combo.commit();
    9898
    99                                                                 combo.onOpen();
    10099                                                        });
    101100                                        },
    102101
  • _source/plugins/floatpanel/plugin.js

     
    5151
    5252                        this._ =
    5353                        {
     54                                editor : editor,
    5455                                // The panel that will be floating.
    5556                                panel : panel,
    5657                                parentElement : parentElement,
     
    102103                                this.allowBlur( false );
    103104                                isShowing = 1;
    104105
     106                                // Record from where the focus is when open panel.
     107                                this._.returnFocus = this._.editor.focusManager.hasFocus ? this._.editor : new CKEDITOR.dom.element( CKEDITOR.document.$.activeElement );
     108
     109
    105110                                var element = this.element,
    106111                                        iframe = this._.iframe,
    107112                                        definition = this._.definition,
     
    164169                                                                return;
    165170
    166171                                                        if ( this.visible && !this._.activeChild && !isShowing )
     172                                                        {
     173                                                                // Panel close is caused by user's navigating away the focus, e.g. click outside the panel.
     174                                                                // DO NOT restore focus in this case.
     175                                                                delete this._.returnFocus;
    167176                                                                this.hide();
     177                                                        }
    168178                                                },
    169179                                                this );
    170180
     
    322332                                        this.element.setStyle( 'display', 'none' );
    323333                                        this.visible = 0;
    324334                                        this.element.getFirst().removeCustomData( 'activePanel' );
    325                                 }
     335
     336                                        // Return focus properly. (#6247)
     337                                        var focusReturn = this._.returnFocus;
     338                                        if ( focusReturn )
     339                                        {
     340                                                // Webkit requires focus moved out panel iframe first.
     341                                                if ( CKEDITOR.env.webkit && focusReturn.type )
     342                                                        focusReturn.getWindow().$.focus();
     343
     344                                                focusReturn.focus();
     345                                        }
     346                                }
    326347                        },
    327348
    328349                        allowBlur : function( allow )   // Prevent editor from hiding the panel. #3222.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy