diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-04-10 22:16:38 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-04-10 22:16:38 +0200 |
commit | e5ba731019ba32749e3c95d0fde30b64b8bcf147 (patch) | |
tree | 697173569cf388efc4c652a9e9a337ade3774722 /ui/jquery.ui.position.js | |
parent | 479530bb61f3c40ef9360613a0a84baf1a14b87b (diff) | |
download | jquery-ui-e5ba731019ba32749e3c95d0fde30b64b8bcf147.tar.gz jquery-ui-e5ba731019ba32749e3c95d0fde30b64b8bcf147.zip |
Position: Use a separate object and argument for the feedback information, keeping position props as they were
Diffstat (limited to 'ui/jquery.ui.position.js')
-rw-r--r-- | ui/jquery.ui.position.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index 003e43c3f..cc0676370 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -226,14 +226,15 @@ $.fn.position = function( options ) { right = (targetOffset.left + targetWidth) - (props.left + elemWidth), top = targetOffset.top - props.top, bottom = (targetOffset.top + targetHeight) - (props.top + elemHeight); - props.horizontal = right < 0 ? "left" : left > 0 ? "right" : "center"; - props.vertical = bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"; + var feedback = {}; + feedback.horizontal = right < 0 ? "left" : left > 0 ? "right" : "center"; + feedback.vertical = bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"; if (Math.max(Math.abs(left), Math.abs(right)) > Math.max(Math.abs(top), Math.abs(bottom))) { - props.important = "horizontal"; + feedback.important = "horizontal"; } else { - props.important = "vertical"; + feedback.important = "vertical"; } - using.apply( this, arguments ); + using.call( this, props, feedback ); }; } elem.offset( $.extend( position, { using: options.using } ) ); |