File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -297,8 +297,8 @@ $.extend( $.simulate.prototype, {
297297 y += dy / moves ;
298298
299299 coord = {
300- clientX : parseInt ( x , 10 ) ,
301- clientY : parseInt ( y , 10 )
300+ clientX : Math . round ( x ) ,
301+ clientY : Math . round ( y )
302302 } ;
303303
304304 this . simulateEvent ( document , "mousemove" , coord ) ;
Original file line number Diff line number Diff line change @@ -28,14 +28,22 @@ asyncTest( "drag moves option", function() {
2828
2929 var moves = 15 ,
3030 calls = 0 ,
31- el = jQuery ( "<div class='top-left'></div>" ) . appendTo ( "#qunit-fixture" ) ;
31+ el = jQuery ( "<div class='top-left'></div>" ) . appendTo ( "#qunit-fixture" ) ,
32+ position ;
3233
33- expect ( moves ) ;
34+ expect ( moves + 2 ) ;
3435
35- jQuery ( document ) . bind ( "mousemove" , function ( ) {
36+ jQuery ( document ) . bind ( "mousedown" , function ( event ) {
37+ position = {
38+ clientX : event . clientX ,
39+ clientY : event . clientY
40+ } ;
41+ } ) . bind ( "mousemove" , function ( event ) {
3642 ok ( true , "mousemove event fired at the document" ) ;
3743 if ( ++ calls === moves ) {
38- jQuery ( document ) . unbind ( "mousemove" ) ;
44+ equal ( position . clientX + 10 , event . clientX , "last mousemove fired at correct clientX" ) ;
45+ equal ( position . clientY + 20 , event . clientY , "last mousemove fired at correct clientX" ) ;
46+ jQuery ( document ) . unbind ( "mousemove" ) . unbind ( "mousedown" ) ;
3947 start ( ) ;
4048 }
4149 } ) ;
You can’t perform that action at this time.
0 commit comments