diff options
author | Tieson Trowbridge <ttrowbridge@arivium.com> | 2018-06-11 23:06:53 +0300 |
---|---|---|
committer | Johann-S <johann.servoire@gmail.com> | 2018-11-20 11:58:04 +0300 |
commit | ab183384ee23ddedf1b2ff490e9a42464395b5e6 (patch) | |
tree | 17ff8f46dbc5100ee6bc0519165e84601c4f832d | |
parent | 7c8cd0f272ff35c4e7bab0b4fe945e54823e82a1 (diff) |
Allows both OL and UL lists for tab buttons
-rw-r--r-- | js/src/tab.js | 4 | ||||
-rw-r--r-- | site/docs/4.1/components/navs.md | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/js/src/tab.js b/js/src/tab.js index 99cfbe2e85..b7b0dd12a2 100644 --- a/js/src/tab.js +++ b/js/src/tab.js @@ -80,7 +80,7 @@ class Tab { const selector = Util.getSelectorFromElement(this._element) 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 = previous[previous.length - 1] } @@ -141,7 +141,7 @@ class Tab { // Private _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).children(Selector.ACTIVE) diff --git a/site/docs/4.1/components/navs.md b/site/docs/4.1/components/navs.md index afa0fed923..7b22464555 100644 --- a/site/docs/4.1/components/navs.md +++ b/site/docs/4.1/components/navs.md @@ -35,7 +35,7 @@ The base `.nav` component does not include any `.active` state. The following ex {% endcapture %} {% 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 %} <nav class="nav"> |