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

add support for ol in tab plugin. fixes #17754

This commit is contained in:
Max Beatty
2016-08-04 16:57:08 -07:00
parent 0416f761dd
commit dc1b4e78d4
2 changed files with 21 additions and 5 deletions

View File

@@ -44,7 +44,7 @@ const Tab = (($) => {
A : 'a',
LI : 'li',
DROPDOWN : '.dropdown',
UL : 'ul:not(.dropdown-menu)',
LIST : 'ul:not(.dropdown-menu), ol:not(.dropdown-menu)',
FADE_CHILD : '> .nav-item .fade, > .fade',
ACTIVE : '.active',
ACTIVE_CHILD : '> .nav-item > .active, > .active',
@@ -85,11 +85,11 @@ const Tab = (($) => {
let target
let previous
let ulElement = $(this._element).closest(Selector.UL)[0]
let listElement = $(this._element).closest(Selector.LIST)[0]
let selector = Util.getSelectorFromElement(this._element)
if (ulElement) {
previous = $.makeArray($(ulElement).find(Selector.ACTIVE))
if (listElement) {
previous = $.makeArray($(listElement).find(Selector.ACTIVE))
previous = previous[previous.length - 1]
}
@@ -118,7 +118,7 @@ const Tab = (($) => {
this._activate(
this._element,
ulElement
listElement
)
let complete = () => {