r3421 committed - Tabs: Made detection of navigation more flexible - now the first desce...

r3421 committed - Tabs: Made detection of navigation more flexible - now the first desce...


Revision: 3421
Author: scott.gonzalez
Date: Sun Nov 8 18:36:32 2009
Log: Tabs: Made detection of navigation more flexible - now the first
descendant 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
http://code.google.com/p/jquery-ui/source/detail?r=3421
Modified:
/trunk/ui/jquery.ui.tabs.js
=======================================
--- /trunk/ui/jquery.ui.tabs.js    Fri Oct 16 18:27:02 2009
+++ /trunk/ui/jquery.ui.tabs.js    Sun Nov 8 18:36:32 2009
@@ -73,7 +73,8 @@
    _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 = $([]);