aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-04-20 11:02:50 -0400
committerScott González <scott.gonzalez@gmail.com>2012-04-20 11:02:50 -0400
commit2cf9948cadf45a24c591d6f7232f2470b4d9743e (patch)
treea253dbd79ac78d9b47edaae486d684a6ae454c76
parent22b7f9a8196e0927bd993edd2ca3d1b1ef7bd79d (diff)
downloadjquery-ui-2cf9948cadf45a24c591d6f7232f2470b4d9743e.tar.gz
jquery-ui-2cf9948cadf45a24c591d6f7232f2470b4d9743e.zip
Position: Use offsets for all calculations in feedback API.
-rw-r--r--tests/visual/position/position_feedback.html2
-rw-r--r--ui/jquery.ui.position.js8
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/visual/position/position_feedback.html b/tests/visual/position/position_feedback.html
index f23d8a299..11bb19f3e 100644
--- a/tests/visual/position/position_feedback.html
+++ b/tests/visual/position/position_feedback.html
@@ -14,7 +14,7 @@
$(function() {
function using( position, feedback ) {
$(this)
- .offset( position )
+ .css( position )
.text( feedback.horizontal + " " + feedback.vertical + " " + feedback.important )
.removeClass( "left right top bottom center middle vertical horizontal" )
.addClass( feedback.horizontal )
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js
index bba4dd4e6..b8764f2bb 100644
--- a/ui/jquery.ui.position.js
+++ b/ui/jquery.ui.position.js
@@ -235,9 +235,9 @@ $.fn.position = function( options ) {
if ( options.using ) {
// adds feedback as second argument to using callback, if present
using = function( props ) {
- var left = targetOffset.left - props.left,
+ var left = targetOffset.left - position.left,
right = left + targetWidth - elemWidth,
- top = targetOffset.top - props.top,
+ top = targetOffset.top - position.top,
bottom = top + targetHeight - elemHeight,
feedback = {
target: {
@@ -249,8 +249,8 @@ $.fn.position = function( options ) {
},
element: {
element: elem,
- left: props.left,
- top: props.top,
+ left: position.left,
+ top: position.top,
width: elemWidth,
height: elemHeight
},