aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2009-01-03 04:42:23 +0000
committerScott González <scott.gonzalez@gmail.com>2009-01-03 04:42:23 +0000
commitab5bc7916830dfb3327ccf74e3b03d0802b221e2 (patch)
treec578df0ddacc2b2910d41f134f2eb9cab3f35d17
parented1b6ded97188f3647a61c99927ac5c4c6faf0ca (diff)
downloadjquery-ui-ab5bc7916830dfb3327ccf74e3b03d0802b221e2.tar.gz
jquery-ui-ab5bc7916830dfb3327ccf74e3b03d0802b221e2.zip
Core: Changed $.ui.contains to use the same logic as jQuery's internal contains function.
-rw-r--r--ui/ui.core.js12
1 files changed, 3 insertions, 9 deletions
diff --git a/ui/ui.core.js b/ui/ui.core.js
index 02e848dc4..6db98e086 100644
--- a/ui/ui.core.js
+++ b/ui/ui.core.js
@@ -38,15 +38,9 @@ $.ui = {
},
contains: function(a, b) {
- var safari2 = $.browser.safari && $.browser.version < 522;
- if (a.contains && !safari2) {
- return a.contains(b);
- }
- if (a.compareDocumentPosition)
- return !!(a.compareDocumentPosition(b) & 16);
- while (b = b.parentNode)
- if (b == a) return true;
- return false;
+ return document.compareDocumentPosition
+ ? a.compareDocumentPosition(b) & 16
+ : a !== b && a.contains(b);
},
cssCache: {},