]> source.dussan.org Git - jquery-ui.git/commitdiff
Tabs: Made detection of navigation more flexible - now the first descendant list...
authorScott González <scott.gonzalez@gmail.com>
Mon, 9 Nov 2009 02:36:32 +0000 (02:36 +0000)
committerScott González <scott.gonzalez@gmail.com>
Mon, 9 Nov 2009 02:36:32 +0000 (02:36 +0000)
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

ui/jquery.ui.tabs.js

index 18515fdf74b8a65686eb2e436b442a94456045b3..34b7daf1c40082f7ba70bce07626624a005f3083 100644 (file)
@@ -73,7 +73,8 @@ $.widget("ui.tabs", {
 
        _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.anchors = this.lis.map(function() { return $('a', this)[0]; });
                this.panels = $([]);