]> source.dussan.org Git - jquery-ui.git/commitdiff
Tabs: Ignore sublists. Fixes #5893 - Tabs: ability to contain sublists.
authorph-ausseil <ph.ausseil@gmail.com>
Thu, 12 Aug 2010 03:06:41 +0000 (23:06 -0400)
committerScott González <scott.gonzalez@gmail.com>
Thu, 12 Aug 2010 03:06:41 +0000 (23:06 -0400)
tests/unit/tabs/tabs.html
tests/unit/tabs/tabs_tickets.js
ui/jquery.ui.tabs.js

index 21123756907e3fc99389066c459f939359274b68..b00c8df032ee19eb6c70bac7c0e875df39da25a1 100644 (file)
                                <ul id="tabs5-list"></ul>
                        </div>
                </div>
+               <div id="tabs6">
+                       <ul id="tabs6-list">
+                               <li><a href="#tabs6-1">1</a>
+                                       <ul>
+                                               <li><a href="#item6-3">3</a></li>
+                                               <li><a href="#item6-4">4</a></li>
+                                       </ul>
+                               </li>
+                               <li><a href="#tabs6-2">2</a></li>
+                       </ul>
+                       <div id="tabs6-1"></div>
+                       <div id="tabs6-2"></div>
+               </div>
        </div>
 </body>
 </html>
index 4d51e905d6c027630b0361dfb92e2727254ed956..475579c89130bed8e900914195099aa8088d1853 100644 (file)
@@ -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);
index 212e465337717fbf79cb09db4541f9244c845f0d..98b90c289ca8740a3062e003e7bcf500f158ddf0 100644 (file)
@@ -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 ];
                });