aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.position.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-04-10 22:16:38 +0200
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-04-10 22:16:38 +0200
commite5ba731019ba32749e3c95d0fde30b64b8bcf147 (patch)
tree697173569cf388efc4c652a9e9a337ade3774722 /ui/jquery.ui.position.js
parent479530bb61f3c40ef9360613a0a84baf1a14b87b (diff)
downloadjquery-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.js11
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 } ) );