Ticket #5681: 5681.patch

File 5681.patch, 1.1 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/contextmenu/plugin.js

     
    5454                onMenu : function( offsetParent, corner, offsetX, offsetY )
    5555                {
    5656                        var menu = this._.menu,
     57                                contextmenu = this,
    5758                                editor = this.editor;
    5859
    5960                        if ( menu )
     
    9293                                        else if ( keystroke == 27 )
    9394                                        {
    9495                                                this.hide();
    95                                                 editor.focus();
     96                                                contextmenu._.editorFocus && editor.focus();
    9697                                        }
    9798                                        return false;
    9899                                };
     
    249250
    250251                show : function( offsetParent, corner, offsetX, offsetY )
    251252                {
    252                         this.editor.focus();
     253                        // Determinate whether editor focus is required before open/ after close. (#5681)
     254                        if ( this._.editorFocus = offsetParent.getDocument().equals( this.editor.document ) || this.editor.focusManager.hasFocus )
     255                                this.editor.focus();
    253256
    254257                        // Selection will be unavailable after context menu shows up
    255258                        // in IE, lock it now.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy