Ticket #6247: 6247.patch

File 6247.patch, 1.7 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/floatpanel/plugin.js

     
    100100                                        block = panel.showBlock( name );
    101101
    102102                                this.allowBlur( false );
     103
     104                                // Record from where the focus is when open panel.
     105                                this._.returnFocus = new CKEDITOR.dom.element( CKEDITOR.document.$.activeElement );
     106
    103107                                isShowing = 1;
    104108
    105109                                var element = this.element,
     
    164168                                                                return;
    165169
    166170                                                        if ( this.visible && !this._.activeChild && !isShowing )
     171                                                        {
     172                                                                // Panel close is caused by user's navigating away the focus, e.g. click outside the panel.
     173                                                                // DO NOT restore focus in this case.
     174                                                                delete this._.returnFocus;
    167175                                                                this.hide();
     176                                                        }
    168177                                                },
    169178                                                this );
    170179
     
    322331                                        this.element.setStyle( 'display', 'none' );
    323332                                        this.visible = 0;
    324333                                        this.element.getFirst().removeCustomData( 'activePanel' );
     334
     335                                        // Return focus properly. (#6247)
     336                                        var focusReturn = this._.returnFocus;
     337                                        focusReturn && ( focusReturn.is( 'iframe' ) ? focusReturn.getFrameDocument().getWindow() : focusReturn ).focus();
    325338                                }
    326339                        },
    327340
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy