]> source.dussan.org Git - jquery-ui.git/commitdiff
Position: Use offsets for all calculations in feedback API.
authorScott González <scott.gonzalez@gmail.com>
Fri, 20 Apr 2012 15:02:50 +0000 (11:02 -0400)
committerScott González <scott.gonzalez@gmail.com>
Fri, 20 Apr 2012 15:02:50 +0000 (11:02 -0400)
tests/visual/position/position_feedback.html
ui/jquery.ui.position.js

index f23d8a2990165b75c649f65c29731cf4b90df016..11bb19f3ee40bb7fecab18ba354eb29f9fdc9159 100644 (file)
@@ -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 )
index bba4dd4e643b029319e5fe0f359d3c5b9de60062..b8764f2bb624694814b1d945b5d0a2386d62af38 100644 (file)
@@ -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
                                                },