]> source.dussan.org Git - jquery-ui.git/commitdiff
Position: Changed document/window detection to be consistent with jQuery core.
authorScott González <scott.gonzalez@gmail.com>
Thu, 19 Nov 2009 16:37:05 +0000 (16:37 +0000)
committerScott González <scott.gonzalez@gmail.com>
Thu, 19 Nov 2009 16:37:05 +0000 (16:37 +0000)
Fixes a bug in IE7/8 where window == document.

ui/jquery.ui.position.js

index 6c5250959171f3ae6d4f63ce9034da3d8468506e..0b7563b10b4a1d6dbbe248826fa655f42ad23da7 100644 (file)
@@ -29,11 +29,11 @@ $.fn.position = function(options) {
                targetHeight,\r
                basePosition;\r
 \r
-       if (options.of == document) {\r
+       if (options.of.nodeType === 9) {\r
                targetWidth = target.width();\r
                targetHeight = target.height();\r
                basePosition = { top: 0, left: 0 };\r
-       } else if (options.of == window) {\r
+       } else if ('scrollTo' in options.of && options.of.document) {\r
                targetWidth = target.width();\r
                targetHeight = target.height();\r
                basePosition = { top: target.scrollTop(), left: target.scrollLeft() };\r