aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-05-11 08:37:27 -0400
committerScott González <scott.gonzalez@gmail.com>2011-05-11 08:37:27 -0400
commit24864de57d9cbfb648c06a26af6a3872d9a14496 (patch)
treef5feeaaf554528a2a4f7dcb1ae44a9e54c2bf5ac /ui
parentbd9dfb59e934b04a42c898d24cca1dd35287bca3 (diff)
downloadjquery-ui-24864de57d9cbfb648c06a26af6a3872d9a14496.tar.gz
jquery-ui-24864de57d9cbfb648c06a26af6a3872d9a14496.zip
Menu: Use appropriate methods for getting scroll values for .prop()/.attr() compat. Fixes #7354 - Autocomplete: Scrollable results don't visually update with jQuery 1.6.
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.menu.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js
index 3cc25062c..6126b4da9 100644
--- a/ui/jquery.ui.menu.js
+++ b/ui/jquery.ui.menu.js
@@ -239,13 +239,13 @@ $.widget("ui.menu", {
var borderTop = parseFloat( $.curCSS( this.element[0], "borderTopWidth", true) ) || 0,
paddingtop = parseFloat( $.curCSS( this.element[0], "paddingTop", true) ) || 0,
offset = item.offset().top - this.element.offset().top - borderTop - paddingtop,
- scroll = this.element.attr( "scrollTop" ),
+ scroll = this.element.scrollTop(),
elementHeight = this.element.height(),
itemHeight = item.height();
if ( offset < 0 ) {
- this.element.attr( "scrollTop", scroll + offset );
+ this.element.scrollTop( scroll + offset );
} else if ( offset + itemHeight > elementHeight ) {
- this.element.attr( "scrollTop", scroll + offset - elementHeight + itemHeight );
+ this.element.scrollTop( scroll + offset - elementHeight + itemHeight );
}
}
@@ -410,7 +410,8 @@ $.widget("ui.menu", {
},
_hasScroll: function() {
- return this.element.height() < this.element.attr( "scrollHeight" );
+ // TODO: just use .prop() when we drop support for jQuery <1.6
+ return this.element.height() < this.element[ $.fn.prop ? "prop" : "attr" ]( "scrollHeight" );
},
select: function( event ) {