diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-04-13 16:05:29 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-04-13 16:05:29 +0200 |
commit | a5fc9eb7db292629271e6414db9e98c3dc60224d (patch) | |
tree | 4a69486080e5176ff62490d3fd963ecd72ab1aaf /ui/jquery.ui.position.js | |
parent | cb67eb535c0f695941235f402cc4b405f70bc022 (diff) | |
download | jquery-ui-a5fc9eb7db292629271e6414db9e98c3dc60224d.tar.gz jquery-ui-a5fc9eb7db292629271e6414db9e98c3dc60224d.zip |
Position: Expose target and element dimensions to allow further customization, like calculating the angle between the two elements
Diffstat (limited to 'ui/jquery.ui.position.js')
-rw-r--r-- | ui/jquery.ui.position.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index 31da2237b..17d43b2a4 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -241,9 +241,22 @@ $.fn.position = function( options ) { top = targetOffset.top - props.top, bottom = (targetOffset.top + targetHeight) - (props.top + elemHeight), feedback = { + target: { + element: target, + left: targetOffset.left, + top: targetOffset.top, + width: targetWidth, + height: targetHeight + }, + element: { + element: elem, + left: props.left, + top: props.top, + width: elemWidth, + height: elemHeight + }, horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", - vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle", - target: target + vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" }, max = Math.max, abs = Math.abs; |