]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Use appropriate methods for getting scroll values for .prop()/.attr...
authorScott González <scott.gonzalez@gmail.com>
Wed, 11 May 2011 12:40:16 +0000 (08:40 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 11 May 2011 12:40:16 +0000 (08:40 -0400)
ui/jquery.ui.autocomplete.js

index dfe3fa3f37449f0a4c9bff124c746353eaa545bd..62fb782dfd398d6568e1b5ab67a6b58f985eea4e 100644 (file)
@@ -490,12 +490,12 @@ $.widget("ui.menu", {
                this.deactivate();
                if (this.hasScroll()) {
                        var offset = item.offset().top - this.element.offset().top,
-                               scroll = this.element.attr("scrollTop"),
+                               scroll = this.element.scrollTop(),
                                elementHeight = this.element.height();
                        if (offset < 0) {
-                               this.element.attr("scrollTop", scroll + offset);
+                               this.element.scrollTop( scroll + offset);
                        } else if (offset >= elementHeight) {
-                               this.element.attr("scrollTop", scroll + offset - elementHeight + item.height());
+                               this.element.scrollTop( scroll + offset - elementHeight + item.height());
                        }
                }
                this.active = item.eq(0)
@@ -601,7 +601,7 @@ $.widget("ui.menu", {
        },
 
        hasScroll: function() {
-               return this.element.height() < this.element.attr("scrollHeight");
+               return this.element.height() < this.element[ $.fn.prop ? "prop" : "attr" ]("scrollHeight");
        },
 
        select: function( event ) {