1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-17 19:06:40 +02:00
This commit is contained in:
Mark Otto
2017-12-22 16:21:54 -08:00
parent 13150872c6
commit 935d45f461
31 changed files with 381 additions and 344 deletions

18
js/dist/tab.js vendored
View File

@@ -142,7 +142,7 @@ var Tab = function ($) {
var isTransitioning = callback && Util.supportsTransitionEnd() && active && $(active).hasClass(ClassName.FADE);
var complete = function complete() {
return _this2._transitionComplete(element, active, isTransitioning, callback);
return _this2._transitionComplete(element, active, callback);
};
if (active && isTransitioning) {
@@ -150,15 +150,11 @@ var Tab = function ($) {
} else {
complete();
}
if (active) {
$(active).removeClass(ClassName.SHOW);
}
};
_proto._transitionComplete = function _transitionComplete(element, active, isTransitioning, callback) {
_proto._transitionComplete = function _transitionComplete(element, active, callback) {
if (active) {
$(active).removeClass(ClassName.ACTIVE);
$(active).removeClass(ClassName.SHOW + " " + ClassName.ACTIVE);
var dropdownChild = $(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
if (dropdownChild) {
@@ -176,12 +172,8 @@ var Tab = function ($) {
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)) {
var dropdownElement = $(element).closest(Selector.DROPDOWN)[0];