aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-10-25 06:39:14 -0400
committerScott González <scott.gonzalez@gmail.com>2012-10-25 06:39:14 -0400
commit2582bfab46613da613f1a3354bc733b68a110b95 (patch)
tree5515634203be660eccf283b14868ade5f2ddf3e5 /tests
parentbc44e61dd9e6797bb23bc3038d43436a8ba052c3 (diff)
downloadjquery-ui-2582bfab46613da613f1a3354bc733b68a110b95.tar.gz
jquery-ui-2582bfab46613da613f1a3354bc733b68a110b95.zip
Position: Removed offset option. Fixes #6982 - Position: Remove offset option.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/all-active.html1
-rw-r--r--tests/unit/all.html1
-rw-r--r--tests/unit/position/position.html3
-rw-r--r--tests/unit/position/position_deprecated.html56
-rw-r--r--tests/unit/position/position_deprecated.js33
-rw-r--r--tests/unit/subsuite.js2
-rw-r--r--tests/visual/position/position_feedback.html29
-rw-r--r--tests/visual/tooltip/tooltip.html6
8 files changed, 17 insertions, 114 deletions
diff --git a/tests/unit/all-active.html b/tests/unit/all-active.html
index 236411475..fe3e05682 100644
--- a/tests/unit/all-active.html
+++ b/tests/unit/all-active.html
@@ -27,7 +27,6 @@
"effects/effects.html",
"menu/menu.html",
"position/position.html",
- "position/position_deprecated.html",
"progressbar/progressbar.html",
//"resizable/resizable.html",
//"selectable/selectable.html",
diff --git a/tests/unit/all.html b/tests/unit/all.html
index e8dac887c..f3e5b33c1 100644
--- a/tests/unit/all.html
+++ b/tests/unit/all.html
@@ -27,7 +27,6 @@
"effects/effects.html",
"menu/menu.html",
"position/position.html",
- "position/position_deprecated.html",
"progressbar/progressbar.html",
//"resizable/resizable.html",
//"selectable/selectable.html",
diff --git a/tests/unit/position/position.html b/tests/unit/position/position.html
index 8738ae667..f3b1ad86c 100644
--- a/tests/unit/position/position.html
+++ b/tests/unit/position/position.html
@@ -5,9 +5,6 @@
<title>jQuery UI Position Test Suite</title>
<script src="../../jquery.js"></script>
- <script>
- $.uiBackCompat = false;
- </script>
<link rel="stylesheet" href="../../../external/qunit.css">
<script src="../../../external/qunit.js"></script>
<script src="../../jquery.simulate.js"></script>
diff --git a/tests/unit/position/position_deprecated.html b/tests/unit/position/position_deprecated.html
deleted file mode 100644
index 84aae61f8..000000000
--- a/tests/unit/position/position_deprecated.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>jQuery UI Position Test Suite</title>
-
- <script src="../../jquery.js"></script>
-
-
-
- <link rel="stylesheet" href="../../../external/qunit.css">
- <script src="../../../external/qunit.js"></script>
- <script src="../../jquery.simulate.js"></script>
- <script src="../testsuite.js"></script>
- <script>
- TestHelpers.loadResources({
- js: [ "ui/jquery.ui.position.js" ]
- });
- </script>
-
- <script src="position_core.js"></script>
- <script src="position_deprecated.js"></script>
- <script src="../swarminject.js"></script>
-</head>
-<body>
-<div id="qunit" style="position:relative; z-index:2;"></div>
-
-<!--
-elements smaller than 20px have a line-height set on them to avoid a bug in IE6
-.height() returns the greater of the height and line-height
--->
-
-<div id="qunit-fixture" style="top: 0; left: 0; z-index:1">
- <div id="el1" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div>
- <div id="el2" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div>
- <div id="parent" style="position: absolute; width: 6px; height: 6px; top: 4px; left: 4px; line-height: 6px;"></div>
- <div id="within" style="position: absolute; width: 12px; height: 12px; top: 2px; left: 0px; line-height: 12px;"></div>
-
- <div id="scrollx" style="position: absolute; top: 0px; left: 0px">
- <div id="elx" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div>
- <div id="parentx" style="position: absolute; width: 20px; height: 20px; top: 40px; left: 40px;"></div>
- </div>
-
- <div style="position: absolute; height: 5000px; width: 5000px;"></div>
-
- <div id="fractions-parent" style="position: absolute; left: 10.7432222px; top: 10.532325px; height: 30px; width: 201px;">
- <div id="fractions-element"></div>
- </div>
-
- <div id="bug-5280" style="height: 30px; width: 201px;">
- <div style="width: 50px; height: 10px;"></div>
- </div>
-</div>
-
-</body>
-</html>
diff --git a/tests/unit/position/position_deprecated.js b/tests/unit/position/position_deprecated.js
deleted file mode 100644
index 789d4e608..000000000
--- a/tests/unit/position/position_deprecated.js
+++ /dev/null
@@ -1,33 +0,0 @@
-(function( $ ) {
-
-test( "offset", function() {
- expect( 3 );
- $( "#elx" ).position({
- my: "left top",
- at: "left bottom",
- of: "#parentx",
- offset: "10",
- collision: "none"
- });
- deepEqual( $( "#elx" ).offset(), { top: 70, left: 50 }, "single value" );
-
- $( "#elx" ).position({
- my: "left top",
- at: "left bottom",
- of: "#parentx",
- offset: "5 -3",
- collision: "none"
- });
- deepEqual( $( "#elx" ).offset(), { top: 57, left: 45 }, "two values" );
-
- $( "#elx" ).position({
- my: "left top",
- at: "left bottom",
- of: "#parentx",
- offset: "5px -3px",
- collision: "none"
- });
- deepEqual( $( "#elx" ).offset(), { top: 57, left: 45 }, "with units" );
-});
-
-}( jQuery ) );
diff --git a/tests/unit/subsuite.js b/tests/unit/subsuite.js
index b583bbd75..148f35b1e 100644
--- a/tests/unit/subsuite.js
+++ b/tests/unit/subsuite.js
@@ -7,7 +7,7 @@ var versions = [
"git"
],
additionalTests = {
- position: [ "position_deprecated.html" ]
+ // component: [ "other_test.html" ]
};
window.testAllVersions = function( widget ) {
diff --git a/tests/visual/position/position_feedback.html b/tests/visual/position/position_feedback.html
index fe1f04e5b..fb3bf00fd 100644
--- a/tests/visual/position/position_feedback.html
+++ b/tests/visual/position/position_feedback.html
@@ -55,25 +55,24 @@
});
element.width( 150 );
- $( document ).on( "mousemove", function( event ) {
- var base = {
+ function positionWithOffset( horizontal, vertical ) {
+ return {
my: "left top",
- at: "left top",
+ at: "left" + (horizontal < 0 ? horizontal : "+" + horizontal) + " " +
+ "top" + (vertical < 0 ? vertical : "+" + vertical),
of: target,
using: using
};
- element.position( $.extend({
- offset: (event.pageX - targetOffset.left) + " " + (event.pageY - targetOffset.top)
- }, base ));
- oppositeElement.position( $.extend({
- offset: (-1 * (event.pageX - targetOffset.left)) + " " + (-1 * (event.pageY - targetOffset.top))
- }, base ));
- leftElement.position( $.extend({
- offset: (-0.9 * (event.pageX - targetOffset.left)) + " " + (0.9 * (event.pageY - targetOffset.top))
- }, base ));
- rightElement.position( $.extend({
- offset: (0.9 * (event.pageX - targetOffset.left)) + " " + (-0.9 * (event.pageY - targetOffset.top))
- }, base) );
+ };
+ $( document ).on( "mousemove", function( event ) {
+ element.position( positionWithOffset(
+ event.pageX - targetOffset.left, event.pageY - targetOffset.top ) );
+ oppositeElement.position( positionWithOffset(
+ -1 * (event.pageX - targetOffset.left), -1 * (event.pageY - targetOffset.top) ) );
+ leftElement.position( positionWithOffset(
+ -0.9 * (event.pageX - targetOffset.left), 0.9 * (event.pageY - targetOffset.top) ) );
+ rightElement.position( positionWithOffset(
+ 0.9 * (event.pageX - targetOffset.left), -0.9 * (event.pageY - targetOffset.top) ) );
});
});
</script>
diff --git a/tests/visual/tooltip/tooltip.html b/tests/visual/tooltip/tooltip.html
index 598af0ee8..706ed5091 100644
--- a/tests/visual/tooltip/tooltip.html
+++ b/tests/visual/tooltip/tooltip.html
@@ -66,8 +66,7 @@
tooltipClass: "ui-state-highlight",
position: {
my: "center top",
- at: "center bottom",
- offset: "0 10"
+ at: "center bottom+10"
}
});
@@ -86,8 +85,7 @@
$( "#buttons" ).tooltip({
position: {
my: "center bottom",
- at: "center top",
- offset: "0 -5"
+ at: "center top-5"
}
});