Ticket #5778: 5778_2.patch
File 5778_2.patch, 1.4 KB (added by , 14 years ago) |
---|
-
_source/plugins/selection/plugin.js
207 207 }); 208 208 } 209 209 210 var scroll; 210 211 // IE fires the "selectionchange" event when clicking 211 212 // inside a selection. We don't want to capture that. 212 body.on( 'mousedown', function ()213 body.on( 'mousedown', function( evt ) 213 214 { 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 } 214 224 disableSave(); 215 225 }); 216 226 217 227 body.on( 'mouseup', 218 function( )228 function( evt ) 219 229 { 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 220 238 saveEnabled = true; 221 239 setTimeout( function() 222 240 {