aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/draggable/draggable_options.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/draggable/draggable_options.js')
-rw-r--r--tests/unit/draggable/draggable_options.js40
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/unit/draggable/draggable_options.js b/tests/unit/draggable/draggable_options.js
index 0e728f8dc..eba6c4731 100644
--- a/tests/unit/draggable/draggable_options.js
+++ b/tests/unit/draggable/draggable_options.js
@@ -85,7 +85,7 @@ test( "{ appendTo: Selector }", function() {
test( "appendTo, default, switching after initialization", function() {
expect( 2 );
- var element = $( "#draggable1" ).draggable({ helper : "clone" });
+ var element = $( "#draggable1" ).draggable({ helper: "clone" });
TestHelpers.draggable.trackAppendedParent( element );
@@ -140,7 +140,7 @@ test( "{ axis: ? }, unexpected", function() {
test( "axis, default, switching after initialization", function() {
expect( 6 );
- var element = $( "#draggable1" ).draggable({ axis : false });
+ var element = $( "#draggable1" ).draggable({ axis: false });
// Any Direction
TestHelpers.draggable.shouldMove( element, "axis: default" );
@@ -504,12 +504,12 @@ test( "cursorAt", function() {
var deltaX = -3,
deltaY = -3,
tests = {
- "false": { cursorAt : false },
- "{ left: -5, top: -5 }": { x: -5, y: -5, cursorAt : { left: -5, top: -5 } },
- "[ 10, 20 ]": { x: 10, y: 20, cursorAt : [ 10, 20 ] },
- "'10 20'": { x: 10, y: 20, cursorAt : "10 20" },
- "{ left: 20, top: 40 }": { x: 20, y: 40, cursorAt : { left: 20, top: 40 } },
- "{ right: 10, bottom: 20 }": { x: 10, y: 20, cursorAt : { right: 10, bottom: 20 } }
+ "false": { cursorAt: false },
+ "{ left: -5, top: -5 }": { x: -5, y: -5, cursorAt: { left: -5, top: -5 } },
+ "[ 10, 20 ]": { x: 10, y: 20, cursorAt: [ 10, 20 ] },
+ "'10 20'": { x: 10, y: 20, cursorAt: "10 20" },
+ "{ left: 20, top: 40 }": { x: 20, y: 40, cursorAt: { left: 20, top: 40 } },
+ "{ right: 10, bottom: 20 }": { x: 10, y: 20, cursorAt: { right: 10, bottom: 20 } }
};
$.each( tests, function( testName, testData ) {
@@ -517,10 +517,10 @@ test( "cursorAt", function() {
var element = $( "#draggable" + ( i + 1 ) ).draggable({
cursorAt: testData.cursorAt,
drag: function( event, ui ) {
- if( !testData.cursorAt ) {
+ if ( !testData.cursorAt ) {
equal( ui.position.left - ui.originalPosition.left, deltaX, testName + " " + position + " left" );
equal( ui.position.top - ui.originalPosition.top, deltaY, testName + " " + position + " top" );
- } else if( testData.cursorAt.right ) {
+ } else if ( testData.cursorAt.right ) {
equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x - TestHelpers.draggable.unreliableOffset, testName + " " + position + " left" );
equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y - TestHelpers.draggable.unreliableOffset, testName + " " +position + " top" );
} else {
@@ -545,12 +545,12 @@ test( "cursorAt, switching after initialization", function() {
var deltaX = -3,
deltaY = -3,
tests = {
- "false": { cursorAt : false },
- "{ left: -5, top: -5 }": { x: -5, y: -5, cursorAt : { left: -5, top: -5 } },
- "[ 10, 20 ]": { x: 10, y: 20, cursorAt : [ 10, 20 ] },
- "'10 20'": { x: 10, y: 20, cursorAt : "10 20" },
- "{ left: 20, top: 40 }": { x: 20, y: 40, cursorAt : { left: 20, top: 40 } },
- "{ right: 10, bottom: 20 }": { x: 10, y: 20, cursorAt : { right: 10, bottom: 20 } }
+ "false": { cursorAt: false },
+ "{ left: -5, top: -5 }": { x: -5, y: -5, cursorAt: { left: -5, top: -5 } },
+ "[ 10, 20 ]": { x: 10, y: 20, cursorAt: [ 10, 20 ] },
+ "'10 20'": { x: 10, y: 20, cursorAt: "10 20" },
+ "{ left: 20, top: 40 }": { x: 20, y: 40, cursorAt: { left: 20, top: 40 } },
+ "{ right: 10, bottom: 20 }": { x: 10, y: 20, cursorAt: { right: 10, bottom: 20 } }
};
$.each( tests, function( testName, testData ) {
@@ -559,10 +559,10 @@ test( "cursorAt, switching after initialization", function() {
element.draggable({
drag: function( event, ui ) {
- if( !testData.cursorAt ) {
+ if ( !testData.cursorAt ) {
equal( ui.position.left - ui.originalPosition.left, deltaX, testName + " " + position + " left" );
equal( ui.position.top - ui.originalPosition.top, deltaY, testName + " " + position + " top" );
- } else if( testData.cursorAt.right ) {
+ } else if ( testData.cursorAt.right ) {
equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x - TestHelpers.draggable.unreliableOffset, testName + " " + position + " left" );
equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y - TestHelpers.draggable.unreliableOffset, testName + " " +position + " top" );
} else {
@@ -672,7 +672,7 @@ test( "helper, default, switching after initialization", function() {
});
/* jshint loopfunc: true */
-(function(){
+(function() {
var k, l, m,
scrollElements = {
"no elements": [],
@@ -689,7 +689,7 @@ test( "helper, default, switching after initialization", function() {
for ( m = 0 ; m < helpers.length; m++ ) {
for ( l = 0; l < positions.length; l++ ) {
for ( k in scrollElements ) {
- (function( position, helper, scrollElements, scrollElementsTitle ){
+ (function( position, helper, scrollElements, scrollElementsTitle ) {
test( "{ helper: '" + helper + "' }, " + position + ", with scroll offset on " + scrollElementsTitle, function() {
expect( scrollPositions.length * 2 );