aboutsummaryrefslogtreecommitdiffstats
path: root/ui/position.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2014-07-24 15:29:40 -0400
committerScott González <scott.gonzalez@gmail.com>2014-07-24 16:05:18 -0400
commit9bb51d308e0a72bc67db948e92345c826a8f724d (patch)
tree59d2207bb9f5741b950c866d1283bf32985bb545 /ui/position.js
parentf7429edfe96d322cdec850f7207efba8125767a6 (diff)
downloadjquery-ui-9bb51d308e0a72bc67db948e92345c826a8f724d.tar.gz
jquery-ui-9bb51d308e0a72bc67db948e92345c826a8f724d.zip
Position: Support positioning within document with jQuery 1.6.x
Fixes #10071 Closes gh-1294
Diffstat (limited to 'ui/position.js')
-rw-r--r--ui/position.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/position.js b/ui/position.js
index 53e5a1d9d..09bc4fe2b 100644
--- a/ui/position.js
+++ b/ui/position.js
@@ -123,8 +123,11 @@ $.position = {
offset: withinElement.offset() || { left: 0, top: 0 },
scrollLeft: withinElement.scrollLeft(),
scrollTop: withinElement.scrollTop(),
- width: isWindow ? withinElement.width() : withinElement.outerWidth(),
- height: isWindow ? withinElement.height() : withinElement.outerHeight()
+
+ // support: jQuery 1.6.x
+ // jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows
+ width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
+ height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
};
}
};