From: Scott González Date: Fri, 20 Apr 2012 15:02:50 +0000 (-0400) Subject: Position: Use offsets for all calculations in feedback API. X-Git-Tag: 1.9.0m8~87^2~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2cf9948cadf45a24c591d6f7232f2470b4d9743e;p=jquery-ui.git Position: Use offsets for all calculations in feedback API. --- 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 },