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() {
|
||||||
function using( position, feedback ) {
|
function using( position, feedback ) {
|
||||||
$(this)
|
$(this)
|
||||||
.offset( position )
|
.css( position )
|
||||||
.text( feedback.horizontal + " " + feedback.vertical + " " + feedback.important )
|
.text( feedback.horizontal + " " + feedback.vertical + " " + feedback.important )
|
||||||
.removeClass( "left right top bottom center middle vertical horizontal" )
|
.removeClass( "left right top bottom center middle vertical horizontal" )
|
||||||
.addClass( feedback.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 ) {
|
if ( options.using ) {
|
||||||
// adds feedback as second argument to using callback, if present
|
// adds feedback as second argument to using callback, if present
|
||||||
using = function( props ) {
|
using = function( props ) {
|
||||||
var left = targetOffset.left - props.left,
|
var left = targetOffset.left - position.left,
|
||||||
right = left + targetWidth - elemWidth,
|
right = left + targetWidth - elemWidth,
|
||||||
top = targetOffset.top - props.top,
|
top = targetOffset.top - position.top,
|
||||||
bottom = top + targetHeight - elemHeight,
|
bottom = top + targetHeight - elemHeight,
|
||||||
feedback = {
|
feedback = {
|
||||||
target: {
|
target: {
|
||||||
@ -249,8 +249,8 @@ $.fn.position = function( options ) {
|
|||||||
},
|
},
|
||||||
element: {
|
element: {
|
||||||
element: elem,
|
element: elem,
|
||||||
left: props.left,
|
left: position.left,
|
||||||
top: props.top,
|
top: position.top,
|
||||||
width: elemWidth,
|
width: elemWidth,
|
||||||
height: elemHeight
|
height: elemHeight
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user