From 03eea0e39dc15b5fc8c811461dd7c08b9e09f660 Mon Sep 17 00:00:00 2001 From: ph-ausseil Date: Wed, 11 Aug 2010 23:06:41 -0400 Subject: [PATCH] Tabs: Ignore sublists. Fixes #5893 - Tabs: ability to contain sublists. --- tests/unit/tabs/tabs.html | 13 +++++++++++++ tests/unit/tabs/tabs_tickets.js | 10 ++++++++++ ui/jquery.ui.tabs.js | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) 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 ]; }); -- 2.39.5