Skip to content

Commit

Permalink
Tabs: Made detection of navigation more flexible - now the first desc…
Browse files Browse the repository at this point in the history
…endant list (ul or ol) found will be used instead of forcing it to be the first child ul.

Fixes #4501 - Tabs should work with ordered lists (<ol>) in addition to unordered (<ul>)
Fixes #4506 - tabs(): allow more flexibility in specifying what list is used
  • Loading branch information
scottgonzalez committed Nov 9, 2009
1 parent b3a095d commit bff49fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/jquery.ui.tabs.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ $.widget("ui.tabs", {


_tabify: function(init) { _tabify: function(init) {


this.list = this.element.children('ul:first'); // use $('li:first').parent() so we can find the first ul/ol in DOM order
this.list = this.element.find('li:first').parent();
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]; }); this.anchors = this.lis.map(function() { return $('a', this)[0]; });
this.panels = $([]); this.panels = $([]);
Expand Down

0 comments on commit bff49fa

Please sign in to comment.