1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-10 23:54:08 +02:00

tab.js: do not remove fade class if there's no initial active pane

This commit is contained in:
Alessandro Chitolina
2017-11-25 16:07:41 +01:00
committed by Johann-S
parent 544b3ee954
commit 80d4a51e79
2 changed files with 37 additions and 14 deletions

View File

@@ -166,7 +166,6 @@ const Tab = (($) => {
const complete = () => this._transitionComplete(
element,
active,
isTransitioning,
callback
)
@@ -174,19 +173,14 @@ const Tab = (($) => {
$(active)
.one(Util.TRANSITION_END, complete)
.emulateTransitionEnd(TRANSITION_DURATION)
} else {
complete()
}
if (active) {
$(active).removeClass(ClassName.SHOW)
}
}
_transitionComplete(element, active, isTransitioning, callback) {
_transitionComplete(element, active, callback) {
if (active) {
$(active).removeClass(ClassName.ACTIVE)
$(active).removeClass(`${ClassName.SHOW} ${ClassName.ACTIVE}`)
const dropdownChild = $(active.parentNode).find(
Selector.DROPDOWN_ACTIVE_CHILD
@@ -206,12 +200,8 @@ const Tab = (($) => {
element.setAttribute('aria-selected', true)
}
if (isTransitioning) {
Util.reflow(element)
$(element).addClass(ClassName.SHOW)
} else {
$(element).removeClass(ClassName.FADE)
}
Util.reflow(element)
$(element).addClass(ClassName.SHOW)
if (element.parentNode &&
$(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {