aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.core.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/ui.core.js')
-rw-r--r--ui/ui.core.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/ui/ui.core.js b/ui/ui.core.js
index 1507fda0f..4e93c6b21 100644
--- a/ui/ui.core.js
+++ b/ui/ui.core.js
@@ -66,7 +66,19 @@ $.ui = {
set[i][1].apply(instance.element, args);
}
}
- }
+ }
+ },
+
+ 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;
},
cssCache: {},
@@ -80,7 +92,7 @@ $.ui = {
//Opera and Safari set width and height to 0px instead of auto
//Safari returns rgba(0,0,0,0) when bgcolor is not set
$.ui.cssCache[name] = !!(
- (!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) ||
+ (!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) ||
!(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor')))
);
try { $('body').get(0).removeChild(tmp.get(0)); } catch(e){}