Ticket #4041: 4041.patch

File 4041.patch, 1.2 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/contextmenu/plugin.js

     
    9393                                        menu.onHide = null;
    9494
    9595                                        if ( CKEDITOR.env.ie )
    96                                                 editor.getSelection().unlock();
     96                                                editor.getSelection().unlock( true );
    9797
    9898                                        this.onHide && this.onHide();
    9999                                },
     
    127127        {
    128128                addTarget : function( element )
    129129                {
     130                        // IE selection has changed on 'contextmenu' event,
     131                        // lock the selection earlier.(#4041)
     132                        if ( CKEDITOR.env.ie )
     133                        {
     134                                element.on( 'mousedown', function( event )
     135                                {
     136                                        if ( event.data.$.button == 2 )
     137                                                this.editor.getSelection().lock();
     138                                }, this );
     139                        }
     140
    130141                        element.on( 'contextmenu', function( event )
    131142                                {
    132143                                        var domEvent = event.data;
     
    138149                                                offsetX = domEvent.$.clientX,
    139150                                                offsetY = domEvent.$.clientY;
    140151
    141                                         CKEDITOR.tools.setTimeout( function()
    142                                                 {
    143                                                         this._.onMenu( offsetParent, null, offsetX, offsetY );
    144                                                 },
    145                                                 0, this );
    146                                 },
     152                                        this._.onMenu( offsetParent, null, offsetX, offsetY );
     153                                },
    147154                                this );
    148155                },
    149156
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy