]> source.dussan.org Git - jquery-ui.git/commitdiff
Button: avoid .last() call to ensure compatibility with jQuery 1.3. Fixed #7089 ...
authorRichard Worth <rdworth@gmail.com>
Mon, 14 Mar 2011 21:18:35 +0000 (17:18 -0400)
committerRichard Worth <rdworth@gmail.com>
Mon, 14 Mar 2011 21:18:35 +0000 (17:18 -0400)
ui/jquery.ui.button.js

index 56e0d2d223c1b53ef89d097099492cdb7b5cd1fe..bddedead641612a7e4cfc9d0216be2c37d76e636 100644 (file)
@@ -200,7 +200,7 @@ $.widget( "ui.button", {
                if ( this.type === "checkbox" || this.type === "radio" ) {
                        // we don't search against the document in case the element
                        // is disconnected from the DOM
-                       var ancestor = this.element.parents().last(),
+                       var ancestor = this.element.parents().filter(":last"),
                                labelSelector = "label[for=" + this.element.attr("id") + "]";
                        this.buttonElement = ancestor.find( labelSelector );
                        if ( !this.buttonElement.length ) {