aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.core.js
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2013-10-29 18:35:42 -0400
committerMike Sherov <mike.sherov@gmail.com>2013-12-03 10:08:12 -0500
commit44b2180782df6ef3324789324fcf3f98b85784a0 (patch)
treeb33d1da4ca66804d116f8a00be258f5b4c5df818 /ui/jquery.ui.core.js
parent77bf202e58a2e6bd505a3013812e4dc217bf7c8a (diff)
downloadjquery-ui-44b2180782df6ef3324789324fcf3f98b85784a0.tar.gz
jquery-ui-44b2180782df6ef3324789324fcf3f98b85784a0.zip
Draggable: normalize lookups for rootNodes when to bust scroll cache. Fixes #9379 - Draggable: position bug in scrollable div
Core: update scrollParent() to support all current supported browsers.
Diffstat (limited to 'ui/jquery.ui.core.js')
-rw-r--r--ui/jquery.ui.core.js21
1 files changed, 10 insertions, 11 deletions
diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js
index e789910df..6340c6d64 100644
--- a/ui/jquery.ui.core.js
+++ b/ui/jquery.ui.core.js
@@ -55,18 +55,17 @@ $.fn.extend({
})( $.fn.focus ),
scrollParent: function() {
- var scrollParent;
- if (($.ui.ie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) {
- scrollParent = this.parents().filter(function() {
- return (/(relative|absolute|fixed)/).test($.css(this,"position")) && (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
- }).eq(0);
- } else {
- scrollParent = this.parents().filter(function() {
- return (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
- }).eq(0);
- }
+ var position = this.css( "position" ),
+ excludeStaticParent = position === "absolute",
+ scrollParent = this.parents().filter( function() {
+ var parent = $( this );
+ if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
+ return false;
+ }
+ return (/(auto|scroll)/).test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
+ }).eq( 0 );
- return ( /fixed/ ).test( this.css( "position") ) || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
+ return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
},
uniqueId: (function() {