1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-19 11:51:23 +02:00
This commit is contained in:
Mark Otto
2017-08-13 12:59:27 -07:00
parent 30e27e7942
commit 2be34d5ce9
30 changed files with 200 additions and 186 deletions

27
js/dist/tab.js vendored
View File

@@ -45,17 +45,18 @@ var Tab = function ($) {
DROPDOWN: '.dropdown',
NAV_LIST_GROUP: '.nav, .list-group',
ACTIVE: '.active',
ACTIVE_UL: '> li > .active',
DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
DROPDOWN_TOGGLE: '.dropdown-toggle',
DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
};
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Tab = function () {
function Tab(element) {
_classCallCheck(this, Tab);
@@ -80,7 +81,8 @@ var Tab = function ($) {
var selector = Util.getSelectorFromElement(this._element);
if (listElement) {
previous = $.makeArray($(listElement).find(Selector.ACTIVE));
var itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE;
previous = $.makeArray($(listElement).find(itemSelector));
previous = previous[previous.length - 1];
}
@@ -138,7 +140,14 @@ var Tab = function ($) {
Tab.prototype._activate = function _activate(element, container, callback) {
var _this2 = this;
var active = $(container).find(Selector.ACTIVE)[0];
var activeElements = void 0;
if (container.nodeName === 'UL') {
activeElements = $(container).find(Selector.ACTIVE_UL);
} else {
activeElements = $(container).children(Selector.ACTIVE);
}
var active = activeElements[0];
var isTransitioning = callback && Util.supportsTransitionEnd() && active && $(active).hasClass(ClassName.FADE);
var complete = function complete() {