From 6bbc43113ccd2722919e4149248c3316c143b287 Mon Sep 17 00:00:00 2001 From: Richard Worth Date: Mon, 14 Mar 2011 17:18:35 -0400 Subject: [PATCH] Button: avoid .last() call to ensure compatibility with jQuery 1.3. Fixed #7089 - Button: .last() used in ui.button but not exists in jQ 1.3 --- ui/jquery.ui.button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 56e0d2d22..bddedead6 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -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 ) { -- 2.39.5