mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Tabs: Ignore sublists. Fixes #5893 - Tabs: ability to contain sublists.
This commit is contained in:
parent
2398f6d23a
commit
03eea0e39d
@ -93,6 +93,19 @@
|
|||||||
<ul id="tabs5-list"></ul>
|
<ul id="tabs5-list"></ul>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -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);
|
})(jQuery);
|
||||||
|
2
ui/jquery.ui.tabs.js
vendored
2
ui/jquery.ui.tabs.js
vendored
@ -103,7 +103,7 @@ $.widget( "ui.tabs", {
|
|||||||
fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash
|
fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash
|
||||||
|
|
||||||
this.list = this.element.find( "ol,ul" ).eq( 0 );
|
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() {
|
this.anchors = this.lis.map(function() {
|
||||||
return $( "a", this )[ 0 ];
|
return $( "a", this )[ 0 ];
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user