1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-11 16:14:04 +02:00

Allows both OL and UL lists for tab buttons

This commit is contained in:
Tieson Trowbridge
2018-06-11 23:06:53 +03:00
committed by Johann-S
parent 7c8cd0f272
commit ab183384ee
2 changed files with 3 additions and 3 deletions

View File

@@ -80,7 +80,7 @@ class Tab {
const selector = Util.getSelectorFromElement(this._element) const selector = Util.getSelectorFromElement(this._element)
if (listElement) { if (listElement) {
const itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector.ACTIVE_UL : Selector.ACTIVE
previous = $.makeArray($(listElement).find(itemSelector)) previous = $.makeArray($(listElement).find(itemSelector))
previous = previous[previous.length - 1] previous = previous[previous.length - 1]
} }
@@ -141,7 +141,7 @@ class Tab {
// Private // Private
_activate(element, container, callback) { _activate(element, container, callback) {
const activeElements = container && container.nodeName === 'UL' const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL')
? $(container).find(Selector.ACTIVE_UL) ? $(container).find(Selector.ACTIVE_UL)
: $(container).children(Selector.ACTIVE) : $(container).children(Selector.ACTIVE)

View File

@@ -35,7 +35,7 @@ The base `.nav` component does not include any `.active` state. The following ex
{% endcapture %} {% endcapture %}
{% include example.html content=example %} {% include example.html content=example %}
Classes are used throughout, so your markup can be super flexible. Use `<ul>`s like above, or roll your own with say a `<nav>` element. Because the `.nav` uses `display: flex`, the nav links behave the same as nav items would, but without the extra markup. Classes are used throughout, so your markup can be super flexible. Use `<ul>`s like above, `<ol>` if the order of your items is important, or roll your own with a `<nav>` element. Because the `.nav` uses `display: flex`, the nav links behave the same as nav items would, but without the extra markup.
{% capture example %} {% capture example %}
<nav class="nav"> <nav class="nav">