diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-11-23 17:42:24 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-11-23 17:42:24 +0000 |
commit | a42894b1d7a248d274ff309bf8b4b3bd45a7d4a8 (patch) | |
tree | 6270d2d3997e5995776f794eb02e4b9be9f01a38 /ui/ui.core.js | |
parent | 0472ff10bbd12648b57905d0833fb6e572853dd5 (diff) | |
download | jquery-ui-a42894b1d7a248d274ff309bf8b4b3bd45a7d4a8.tar.gz jquery-ui-a42894b1d7a248d274ff309bf8b4b3bd45a7d4a8.zip |
core: improved logic of $.fn.scrollParent, taking positioning in account
draggable: fixed and updated tests, rewrote positioning core, now passes the test suite completely in FF, IE6, IE7
Diffstat (limited to 'ui/ui.core.js')
-rw-r--r-- | ui/ui.core.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/ui/ui.core.js b/ui/ui.core.js index 7bafe917a..172968bde 100644 --- a/ui/ui.core.js +++ b/ui/ui.core.js @@ -187,9 +187,21 @@ $.fn.extend({ }, scrollParent: function() { - return $(this).parents().filter(function() { - return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); - }).eq(0); + + var scrollParent; + if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { + scrollParent = this.parents().filter(function() { + return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } else { + scrollParent = this.parents().filter(function() { + return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } + + return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; + + } }); |