]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Allows both OL and UL lists for tab buttons
authorTieson Trowbridge <ttrowbridge@arivium.com>
Mon, 11 Jun 2018 20:06:53 +0000 (23:06 +0300)
committerJohann-S <johann.servoire@gmail.com>
Tue, 20 Nov 2018 08:58:04 +0000 (09:58 +0100)
js/src/tab.js
site/docs/4.1/components/navs.md

index 99cfbe2e85b2b7f0cc9fc6477f550be9e621fa4a..b7b0dd12a28c5894a532c0647ce1e0e20d03e2a7 100644 (file)
@@ -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)
 
index afa0fed9235b91ef0d12538fd59c536bfb051699..7b22464555bb16c26df700db89b7e7c3e4de5eca 100644 (file)
@@ -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">