From 24c26e534dd7d70fa4f7de83f343fe07cbf2ce46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 24 Jul 2014 15:29:40 -0400 Subject: [PATCH] Position: Support positioning within document with jQuery 1.6.x Fixes #10071 --- ui/position.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/position.js b/ui/position.js index 53e5a1d9d7a..09bc4fe2b5c 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() }; } };