From: ph-ausseil Date: Thu, 12 Aug 2010 03:06:41 +0000 (-0400) Subject: Tabs: Ignore sublists. Fixes #5893 - Tabs: ability to contain sublists. X-Git-Tag: 1.8.5~63 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=03eea0e39dc15b5fc8c811461dd7c08b9e09f660;p=jquery-ui.git Tabs: Ignore sublists. Fixes #5893 - Tabs: ability to contain sublists. --- diff --git a/tests/unit/tabs/tabs.html b/tests/unit/tabs/tabs.html index 211237569..b00c8df03 100644 --- a/tests/unit/tabs/tabs.html +++ b/tests/unit/tabs/tabs.html @@ -93,6 +93,19 @@ +
+ +
+
+
diff --git a/tests/unit/tabs/tabs_tickets.js b/tests/unit/tabs/tabs_tickets.js index 4d51e905d..475579c89 100644 --- a/tests/unit/tabs/tabs_tickets.js +++ b/tests/unit/tabs/tabs_tickets.js @@ -71,4 +71,14 @@ test('#5069 - ui.tabs.add creates two tab panels when using a full URL', functio }); +test('#5893 - Sublist in the tab list are considered as tab', function() { + // http://dev.jqueryui.com/ticket/5893 + expect(1); + + el = $('#tabs6').tabs(); + equals(el.tabs( "length" ), 2, 'should contain 2 tab'); + +}); + + })(jQuery); diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index 212e46533..98b90c289 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -103,7 +103,7 @@ $.widget( "ui.tabs", { fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash this.list = this.element.find( "ol,ul" ).eq( 0 ); - this.lis = $( "li:has(a[href])", this.list ); + this.lis = $( " > li:has(a[href])", this.list ); this.anchors = this.lis.map(function() { return $( "a", this )[ 0 ]; });