mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-17 19:06:40 +02:00
grunt
This commit is contained in:
20
js/dist/tab.js
vendored
20
js/dist/tab.js
vendored
@@ -42,14 +42,10 @@ var Tab = function ($) {
|
||||
};
|
||||
|
||||
var Selector = {
|
||||
A: 'a',
|
||||
LI: 'li',
|
||||
DROPDOWN: '.dropdown',
|
||||
LIST: 'ul:not(.dropdown-menu), ol:not(.dropdown-menu), nav:not(.dropdown-menu), .list-group:not(.dropdown-menu)',
|
||||
FADE_CHILD: '> .nav-item .fade, > .list-group-item .fade, > .fade',
|
||||
NAV_LIST_GROUP: '.nav, .list-group',
|
||||
ACTIVE: '.active',
|
||||
ACTIVE_CHILD: '> .nav-item > .active, > .list-group-item > .active, > .active',
|
||||
DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"]',
|
||||
DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
|
||||
DROPDOWN_TOGGLE: '.dropdown-toggle',
|
||||
DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
|
||||
};
|
||||
@@ -80,7 +76,7 @@ var Tab = function ($) {
|
||||
|
||||
var target = void 0;
|
||||
var previous = void 0;
|
||||
var listElement = $(this._element).closest(Selector.LIST)[0];
|
||||
var listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0];
|
||||
var selector = Util.getSelectorFromElement(this._element);
|
||||
|
||||
if (listElement) {
|
||||
@@ -142,8 +138,8 @@ var Tab = function ($) {
|
||||
Tab.prototype._activate = function _activate(element, container, callback) {
|
||||
var _this2 = this;
|
||||
|
||||
var active = $(container).find(Selector.ACTIVE_CHILD)[0];
|
||||
var isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || Boolean($(container).find(Selector.FADE_CHILD)[0]));
|
||||
var active = $(container).find(Selector.ACTIVE)[0];
|
||||
var isTransitioning = callback && Util.supportsTransitionEnd() && active && $(active).hasClass(ClassName.FADE);
|
||||
|
||||
var complete = function complete() {
|
||||
return _this2._transitionComplete(element, active, isTransitioning, callback);
|
||||
@@ -163,9 +159,6 @@ var Tab = function ($) {
|
||||
Tab.prototype._transitionComplete = function _transitionComplete(element, active, isTransitioning, callback) {
|
||||
if (active) {
|
||||
$(active).removeClass(ClassName.ACTIVE);
|
||||
if ($(active).hasClass('list-group-item')) {
|
||||
$(active).find('a.nav-link').removeClass(ClassName.ACTIVE);
|
||||
}
|
||||
|
||||
var dropdownChild = $(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
|
||||
|
||||
@@ -177,9 +170,6 @@ var Tab = function ($) {
|
||||
}
|
||||
|
||||
$(element).addClass(ClassName.ACTIVE);
|
||||
if ($(element.parentNode).hasClass('list-group-item')) {
|
||||
$(element.parentNode).addClass(ClassName.ACTIVE);
|
||||
}
|
||||
element.setAttribute('aria-expanded', true);
|
||||
|
||||
if (isTransitioning) {
|
||||
|
Reference in New Issue
Block a user