mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-10-05 01:44:18 +00:00
Position: Use offsets for all calculations in feedback API.
This commit is contained in:
parent
22b7f9a819
commit
2cf9948cad
@ -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 )
|
||||
|
8
ui/jquery.ui.position.js
vendored
8
ui/jquery.ui.position.js
vendored
@ -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
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user