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:
committed by
Johann-S
parent
544b3ee954
commit
80d4a51e79
@@ -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)) {
|
||||
|
Reference in New Issue
Block a user