Ticket #5778: 5778_2.patch

File 5778_2.patch, 1.4 KB (added by Sa'ar Zac Elias, 14 years ago)

Updated patch

  • _source/plugins/selection/plugin.js

     
    207207                                                        });
    208208                                                }
    209209
     210                                                var scroll;
    210211                                                // IE fires the "selectionchange" event when clicking
    211212                                                // inside a selection. We don't want to capture that.
    212                                                 body.on( 'mousedown', function ()
     213                                                body.on( 'mousedown', function( evt )
    213214                                                {
     215                                                        // IE scrolls document to top on right mousedown
     216                                                        // when editor has no focus, remember this scroll
     217                                                        // position and revert it before context menu opens. (#5778)
     218                                                        if ( evt.data.$.button == 2 )
     219                                                        {
     220                                                                var sel = editor.document.$.selection;
     221                                                                if ( sel.type == 'None' )
     222                                                                        scroll = editor.window.getScrollPosition();
     223                                                        }
    214224                                                        disableSave();
    215225                                                });
    216226
    217227                                                body.on( 'mouseup',
    218                                                         function()
     228                                                        function( evt )
    219229                                                        {
     230                                                                // Restore recorded scroll position when needed on right mouseup.
     231                                                                if ( evt.data.$.button == 2 && scroll )
     232                                                                {
     233                                                                        editor.document.$.documentElement.scrollLeft = scroll.x;
     234                                                                        editor.document.$.documentElement.scrollTop = scroll.y;
     235                                                                }
     236                                                                scroll = null; 
     237
    220238                                                                saveEnabled = true;
    221239                                                                setTimeout( function()
    222240                                                                        {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy