From ab183384ee23ddedf1b2ff490e9a42464395b5e6 Mon Sep 17 00:00:00 2001 From: Tieson Trowbridge Date: Mon, 11 Jun 2018 23:06:53 +0300 Subject: [PATCH] Allows both OL and UL lists for tab buttons --- js/src/tab.js | 4 ++-- 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 `