From 3cc921dd3da81612a9fd9d33357d4a99ba4fd01e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 19 Nov 2009 16:37:05 +0000 Subject: [PATCH] Position: Changed document/window detection to be consistent with jQuery core. Fixes a bug in IE7/8 where window == document. --- ui/jquery.ui.position.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index 6c5250959..0b7563b10 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -29,11 +29,11 @@ $.fn.position = function(options) { targetHeight, basePosition; - if (options.of == document) { + if (options.of.nodeType === 9) { targetWidth = target.width(); targetHeight = target.height(); basePosition = { top: 0, left: 0 }; - } else if (options.of == window) { + } else if ('scrollTo' in options.of && options.of.document) { targetWidth = target.width(); targetHeight = target.height(); basePosition = { top: target.scrollTop(), left: target.scrollLeft() }; -- 2.39.5