diff options
author | Scott González <scott.gonzalez@gmail.com> | 2008-07-11 01:57:19 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2008-07-11 01:57:19 +0000 |
commit | 9b7ab1621d0b0b0045a785b0f458d142bd98559a (patch) | |
tree | 4ae19045fd9e262e9b45e0b947d4fc34d31d85d1 /ui | |
parent | bb0cac9cb9d3a1de67999220c38aad42af17da0b (diff) | |
download | jquery-ui-9b7ab1621d0b0b0045a785b0f458d142bd98559a.tar.gz jquery-ui-9b7ab1621d0b0b0045a785b0f458d142bd98559a.zip |
Core: cleaned up $.ui.hasScroll().
Diffstat (limited to 'ui')
-rw-r--r-- | ui/ui.core.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/ui/ui.core.js b/ui/ui.core.js index 339d70704..00167f1e7 100644 --- a/ui/ui.core.js +++ b/ui/ui.core.js @@ -53,9 +53,17 @@ $.ui = { $(el).attr('unselectable', 'off').css('MozUserSelect', ''); }, hasScroll: function(e, a) { - var scroll = /top/.test(a||"top") ? 'scrollTop' : 'scrollLeft', has = false; - if (e[scroll] > 0) return true; e[scroll] = 1; - has = e[scroll] > 0 ? true : false; e[scroll] = 0; + var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop', + has = false; + + if (e[scroll] > 0) { return true; } + + // TODO: determine which cases actually cause this to happen + // if the element doesn't have the scroll set, see if it's possible to + // set the scroll + e[scroll] = 1; + has = (e[scroll] > 0); + e[scroll] = 0; return has; } }; |