diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-04-20 14:13:52 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-04-20 14:13:52 +0200 |
commit | cfa6aa328e21514c2eec928272d769f77bc62e56 (patch) | |
tree | 151c135abaebbdfa9cfe3e8b1b836d56fa96de20 /ui/jquery.ui.position.js | |
parent | be3af5bc64c125ac933a7d80300884fe5bb83e24 (diff) | |
download | jquery-ui-cfa6aa328e21514c2eec928272d769f77bc62e56.tar.gz jquery-ui-cfa6aa328e21514c2eec928272d769f77bc62e56.zip |
Position: offset() always returns null for window, so provide default 0/0 coordinates to avoid checks further down
Diffstat (limited to 'ui/jquery.ui.position.js')
-rw-r--r-- | ui/jquery.ui.position.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index ea176688e..5a2ede2b8 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -71,7 +71,7 @@ $.position = { return { element: withinElement, isWindow: isWindow, - offset: withinElement.offset(), + offset: withinElement.offset() || { left: 0, top: 0 }, scrollLeft: withinElement.scrollLeft(), scrollTop: withinElement.scrollTop(), width: isWindow ? withinElement.width() : withinElement.outerWidth(), @@ -361,7 +361,7 @@ $.ui.position = { } var within = data.within, - withinOffset = ( within.isWindow ? 0 : within.offset.left ) + within.scrollLeft, + withinOffset = within.offset.left + within.scrollLeft, outerWidth = within.width, offsetLeft = within.isWindow ? 0 : within.offset.left, collisionPosLeft = position.left - data.collisionPosition.marginLeft, @@ -399,7 +399,7 @@ $.ui.position = { } var within = data.within, - withinOffset = ( within.isWindow ? 0 : within.offset.top ) + within.scrollTop, + withinOffset = within.offset.top + within.scrollTop, outerHeight = within.height, offsetTop = within.isWindow ? 0 : within.offset.top, collisionPosTop = position.top - data.collisionPosition.marginTop, |