@@ -85,7 +85,7 @@ test( "{ appendTo: Selector }", function() {
85
85
test ( "appendTo, default, switching after initialization" , function ( ) {
86
86
expect ( 2 ) ;
87
87
88
- var element = $ ( "#draggable1" ) . draggable ( { helper : "clone" } ) ;
88
+ var element = $ ( "#draggable1" ) . draggable ( { helper : "clone" } ) ;
89
89
90
90
TestHelpers . draggable . trackAppendedParent ( element ) ;
91
91
@@ -140,7 +140,7 @@ test( "{ axis: ? }, unexpected", function() {
140
140
test ( "axis, default, switching after initialization" , function ( ) {
141
141
expect ( 6 ) ;
142
142
143
- var element = $ ( "#draggable1" ) . draggable ( { axis : false } ) ;
143
+ var element = $ ( "#draggable1" ) . draggable ( { axis : false } ) ;
144
144
145
145
// Any Direction
146
146
TestHelpers . draggable . shouldMove ( element , "axis: default" ) ;
@@ -504,23 +504,23 @@ test( "cursorAt", function() {
504
504
var deltaX = - 3 ,
505
505
deltaY = - 3 ,
506
506
tests = {
507
- "false" : { cursorAt : false } ,
508
- "{ left: -5, top: -5 }" : { x : - 5 , y : - 5 , cursorAt : { left : - 5 , top : - 5 } } ,
509
- "[ 10, 20 ]" : { x : 10 , y : 20 , cursorAt : [ 10 , 20 ] } ,
510
- "'10 20'" : { x : 10 , y : 20 , cursorAt : "10 20" } ,
511
- "{ left: 20, top: 40 }" : { x : 20 , y : 40 , cursorAt : { left : 20 , top : 40 } } ,
512
- "{ right: 10, bottom: 20 }" : { x : 10 , y : 20 , cursorAt : { right : 10 , bottom : 20 } }
507
+ "false" : { cursorAt : false } ,
508
+ "{ left: -5, top: -5 }" : { x : - 5 , y : - 5 , cursorAt : { left : - 5 , top : - 5 } } ,
509
+ "[ 10, 20 ]" : { x : 10 , y : 20 , cursorAt : [ 10 , 20 ] } ,
510
+ "'10 20'" : { x : 10 , y : 20 , cursorAt : "10 20" } ,
511
+ "{ left: 20, top: 40 }" : { x : 20 , y : 40 , cursorAt : { left : 20 , top : 40 } } ,
512
+ "{ right: 10, bottom: 20 }" : { x : 10 , y : 20 , cursorAt : { right : 10 , bottom : 20 } }
513
513
} ;
514
514
515
515
$ . each ( tests , function ( testName , testData ) {
516
516
$ . each ( [ "relative" , "absolute" ] , function ( i , position ) {
517
517
var element = $ ( "#draggable" + ( i + 1 ) ) . draggable ( {
518
518
cursorAt : testData . cursorAt ,
519
519
drag : function ( event , ui ) {
520
- if ( ! testData . cursorAt ) {
520
+ if ( ! testData . cursorAt ) {
521
521
equal ( ui . position . left - ui . originalPosition . left , deltaX , testName + " " + position + " left" ) ;
522
522
equal ( ui . position . top - ui . originalPosition . top , deltaY , testName + " " + position + " top" ) ;
523
- } else if ( testData . cursorAt . right ) {
523
+ } else if ( testData . cursorAt . right ) {
524
524
equal ( ui . helper . width ( ) - ( event . clientX - ui . offset . left ) , testData . x - TestHelpers . draggable . unreliableOffset , testName + " " + position + " left" ) ;
525
525
equal ( ui . helper . height ( ) - ( event . clientY - ui . offset . top ) , testData . y - TestHelpers . draggable . unreliableOffset , testName + " " + position + " top" ) ;
526
526
} else {
@@ -545,12 +545,12 @@ test( "cursorAt, switching after initialization", function() {
545
545
var deltaX = - 3 ,
546
546
deltaY = - 3 ,
547
547
tests = {
548
- "false" : { cursorAt : false } ,
549
- "{ left: -5, top: -5 }" : { x : - 5 , y : - 5 , cursorAt : { left : - 5 , top : - 5 } } ,
550
- "[ 10, 20 ]" : { x : 10 , y : 20 , cursorAt : [ 10 , 20 ] } ,
551
- "'10 20'" : { x : 10 , y : 20 , cursorAt : "10 20" } ,
552
- "{ left: 20, top: 40 }" : { x : 20 , y : 40 , cursorAt : { left : 20 , top : 40 } } ,
553
- "{ right: 10, bottom: 20 }" : { x : 10 , y : 20 , cursorAt : { right : 10 , bottom : 20 } }
548
+ "false" : { cursorAt : false } ,
549
+ "{ left: -5, top: -5 }" : { x : - 5 , y : - 5 , cursorAt : { left : - 5 , top : - 5 } } ,
550
+ "[ 10, 20 ]" : { x : 10 , y : 20 , cursorAt : [ 10 , 20 ] } ,
551
+ "'10 20'" : { x : 10 , y : 20 , cursorAt : "10 20" } ,
552
+ "{ left: 20, top: 40 }" : { x : 20 , y : 40 , cursorAt : { left : 20 , top : 40 } } ,
553
+ "{ right: 10, bottom: 20 }" : { x : 10 , y : 20 , cursorAt : { right : 10 , bottom : 20 } }
554
554
} ;
555
555
556
556
$ . each ( tests , function ( testName , testData ) {
@@ -559,10 +559,10 @@ test( "cursorAt, switching after initialization", function() {
559
559
560
560
element . draggable ( {
561
561
drag : function ( event , ui ) {
562
- if ( ! testData . cursorAt ) {
562
+ if ( ! testData . cursorAt ) {
563
563
equal ( ui . position . left - ui . originalPosition . left , deltaX , testName + " " + position + " left" ) ;
564
564
equal ( ui . position . top - ui . originalPosition . top , deltaY , testName + " " + position + " top" ) ;
565
- } else if ( testData . cursorAt . right ) {
565
+ } else if ( testData . cursorAt . right ) {
566
566
equal ( ui . helper . width ( ) - ( event . clientX - ui . offset . left ) , testData . x - TestHelpers . draggable . unreliableOffset , testName + " " + position + " left" ) ;
567
567
equal ( ui . helper . height ( ) - ( event . clientY - ui . offset . top ) , testData . y - TestHelpers . draggable . unreliableOffset , testName + " " + position + " top" ) ;
568
568
} else {
@@ -672,7 +672,7 @@ test( "helper, default, switching after initialization", function() {
672
672
} ) ;
673
673
674
674
/* jshint loopfunc: true */
675
- ( function ( ) {
675
+ ( function ( ) {
676
676
var k , l , m ,
677
677
scrollElements = {
678
678
"no elements" : [ ] ,
@@ -689,7 +689,7 @@ test( "helper, default, switching after initialization", function() {
689
689
for ( m = 0 ; m < helpers . length ; m ++ ) {
690
690
for ( l = 0 ; l < positions . length ; l ++ ) {
691
691
for ( k in scrollElements ) {
692
- ( function ( position , helper , scrollElements , scrollElementsTitle ) {
692
+ ( function ( position , helper , scrollElements , scrollElementsTitle ) {
693
693
test ( "{ helper: '" + helper + "' }, " + position + ", with scroll offset on " + scrollElementsTitle , function ( ) {
694
694
expect ( scrollPositions . length * 2 ) ;
695
695
0 commit comments