Ticket #24425: 24425.5.diff
File 24425.5.diff, 1.4 KB (added by , 10 years ago) |
---|
-
wp-admin/js/revisions.js
302 302 value: 0, 303 303 min: 0, 304 304 max: 1, 305 step: 1305 animate: true // enables click to slide 306 306 }); 307 307 }, 308 308 … … 344 344 * also swaps in the appropriate models - left handled or right handled 345 345 */ 346 346 start: function( event, ui ) { 347 // track the mouse position to enable smooth dragging, overrides default jquery ui step behaviour 348 $( window ).mousemove( function( e ) { 349 $( ui.handle ).css( 'left', e.clientX - $( '#diff-slider' ).offset().left ); // subtract offset of container 350 }); 351 347 352 // Not needed in one mode 348 353 if ( this.singleRevision ) 349 354 return; … … 387 392 * the other handle compares to this handle's position, so if it changes they need to be recalculated 388 393 */ 389 394 stop: function( event, ui ) { 395 $( window ).unbind( 'mousemove' ); // stop tracking the mouse 396 /** 397 * pop the handle back to the step position by resetting the value(s) 398 */ 399 if ( Diff.slider.singleRevision ) { 400 Diff.slider.refresh({ 401 value: Diff.rightDiff - 1 402 } ); 403 } else { 404 Diff.slider.refresh( { 405 values: [ isRtl ? Diff.rightDiff : Diff.leftDiff, isRtl ? Diff.leftDiff : Diff.rightDiff ] 406 } ); 407 } 408 390 409 // Not needed in one mode 391 410 if ( this.singleRevision ) 392 411 return;