1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-13 17:14:04 +02:00
This commit is contained in:
Mark Otto
2016-10-27 09:51:22 -07:00
parent a26080c047
commit 9dbfc90eae
49 changed files with 819 additions and 362 deletions

4
js/dist/alert.js vendored
View File

@@ -38,7 +38,7 @@ var Alert = function ($) {
var ClassName = {
ALERT: 'alert',
FADE: 'fade',
IN: 'in'
ACTIVE: 'active'
};
/**
@@ -101,7 +101,7 @@ var Alert = function ($) {
};
Alert.prototype._removeElement = function _removeElement(element) {
$(element).removeClass(ClassName.IN);
$(element).removeClass(ClassName.ACTIVE);
if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) {
this._destroyElement(element);

File diff suppressed because one or more lines are too long

18
js/dist/collapse.js vendored
View File

@@ -46,7 +46,7 @@ var Collapse = function ($) {
};
var ClassName = {
IN: 'in',
ACTIVE: 'active',
COLLAPSE: 'collapse',
COLLAPSING: 'collapsing',
COLLAPSED: 'collapsed'
@@ -58,7 +58,7 @@ var Collapse = function ($) {
};
var Selector = {
ACTIVES: '.card > .in, .card > .collapsing',
ACTIVES: '.card > .active, .card > .collapsing',
DATA_TOGGLE: '[data-toggle="collapse"]'
};
@@ -93,7 +93,7 @@ var Collapse = function ($) {
// public
Collapse.prototype.toggle = function toggle() {
if ($(this._element).hasClass(ClassName.IN)) {
if ($(this._element).hasClass(ClassName.ACTIVE)) {
this.hide();
} else {
this.show();
@@ -103,7 +103,7 @@ var Collapse = function ($) {
Collapse.prototype.show = function show() {
var _this = this;
if (this._isTransitioning || $(this._element).hasClass(ClassName.IN)) {
if (this._isTransitioning || $(this._element).hasClass(ClassName.ACTIVE)) {
return;
}
@@ -111,7 +111,7 @@ var Collapse = function ($) {
var activesData = void 0;
if (this._parent) {
actives = $.makeArray($(Selector.ACTIVES));
actives = $.makeArray($(this._parent).find(Selector.ACTIVES));
if (!actives.length) {
actives = null;
}
@@ -151,7 +151,7 @@ var Collapse = function ($) {
this.setTransitioning(true);
var complete = function complete() {
$(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.IN);
$(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.ACTIVE);
_this._element.style[dimension] = '';
@@ -176,7 +176,7 @@ var Collapse = function ($) {
Collapse.prototype.hide = function hide() {
var _this2 = this;
if (this._isTransitioning || !$(this._element).hasClass(ClassName.IN)) {
if (this._isTransitioning || !$(this._element).hasClass(ClassName.ACTIVE)) {
return;
}
@@ -193,7 +193,7 @@ var Collapse = function ($) {
Util.reflow(this._element);
$(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.IN);
$(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.ACTIVE);
this._element.setAttribute('aria-expanded', false);
@@ -261,7 +261,7 @@ var Collapse = function ($) {
Collapse.prototype._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
if (element) {
var isOpen = $(element).hasClass(ClassName.IN);
var isOpen = $(element).hasClass(ClassName.ACTIVE);
element.setAttribute('aria-expanded', isOpen);
if (triggerArray.length) {

File diff suppressed because one or more lines are too long

12
js/dist/dropdown.js vendored
View File

@@ -41,7 +41,7 @@ var Dropdown = function ($) {
var ClassName = {
BACKDROP: 'dropdown-backdrop',
DISABLED: 'disabled',
OPEN: 'open'
ACTIVE: 'active'
};
var Selector = {
@@ -79,7 +79,7 @@ var Dropdown = function ($) {
}
var parent = Dropdown._getParentFromElement(this);
var isActive = $(parent).hasClass(ClassName.OPEN);
var isActive = $(parent).hasClass(ClassName.ACTIVE);
Dropdown._clearMenus();
@@ -108,7 +108,7 @@ var Dropdown = function ($) {
this.focus();
this.setAttribute('aria-expanded', 'true');
$(parent).toggleClass(ClassName.OPEN);
$(parent).toggleClass(ClassName.ACTIVE);
$(parent).trigger($.Event(Event.SHOWN, relatedTarget));
return false;
@@ -161,7 +161,7 @@ var Dropdown = function ($) {
var parent = Dropdown._getParentFromElement(toggles[i]);
var relatedTarget = { relatedTarget: toggles[i] };
if (!$(parent).hasClass(ClassName.OPEN)) {
if (!$(parent).hasClass(ClassName.ACTIVE)) {
continue;
}
@@ -177,7 +177,7 @@ var Dropdown = function ($) {
toggles[i].setAttribute('aria-expanded', 'false');
$(parent).removeClass(ClassName.OPEN).trigger($.Event(Event.HIDDEN, relatedTarget));
$(parent).removeClass(ClassName.ACTIVE).trigger($.Event(Event.HIDDEN, relatedTarget));
}
};
@@ -205,7 +205,7 @@ var Dropdown = function ($) {
}
var parent = Dropdown._getParentFromElement(this);
var isActive = $(parent).hasClass(ClassName.OPEN);
var isActive = $(parent).hasClass(ClassName.ACTIVE);
if (!isActive && event.which !== ESCAPE_KEYCODE || isActive && event.which === ESCAPE_KEYCODE) {

File diff suppressed because one or more lines are too long

10
js/dist/modal.js vendored
View File

@@ -62,7 +62,7 @@ var Modal = function ($) {
BACKDROP: 'modal-backdrop',
OPEN: 'modal-open',
FADE: 'fade',
IN: 'in'
ACTIVE: 'active'
};
var Selector = {
@@ -157,7 +157,7 @@ var Modal = function ($) {
$(document).off(Event.FOCUSIN);
$(this._element).removeClass(ClassName.IN);
$(this._element).removeClass(ClassName.ACTIVE);
$(this._element).off(Event.CLICK_DISMISS);
$(this._dialog).off(Event.MOUSEDOWN_DISMISS);
@@ -215,7 +215,7 @@ var Modal = function ($) {
Util.reflow(this._element);
}
$(this._element).addClass(ClassName.IN);
$(this._element).addClass(ClassName.ACTIVE);
if (this._config.focus) {
this._enforceFocus();
@@ -328,7 +328,7 @@ var Modal = function ($) {
Util.reflow(this._backdrop);
}
$(this._backdrop).addClass(ClassName.IN);
$(this._backdrop).addClass(ClassName.ACTIVE);
if (!callback) {
return;
@@ -341,7 +341,7 @@ var Modal = function ($) {
$(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
} else if (!this._isShown && this._backdrop) {
$(this._backdrop).removeClass(ClassName.IN);
$(this._backdrop).removeClass(ClassName.ACTIVE);
var callbackRemove = function callbackRemove() {
_this6._removeBackdrop();

File diff suppressed because one or more lines are too long

4
js/dist/popover.js vendored
View File

@@ -42,7 +42,7 @@ var Popover = function ($) {
var ClassName = {
FADE: 'fade',
IN: 'in'
ACTIVE: 'active'
};
var Selector = {
@@ -95,7 +95,7 @@ var Popover = function ($) {
this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
this.setElementContent($tip.find(Selector.CONTENT), this._getContent());
$tip.removeClass(ClassName.FADE).removeClass(ClassName.IN);
$tip.removeClass(ClassName.FADE).removeClass(ClassName.ACTIVE);
this.cleanupTether();
};

File diff suppressed because one or more lines are too long

10
js/dist/tab.js vendored
View File

@@ -44,7 +44,7 @@ var Tab = function ($) {
A: 'a',
LI: 'li',
DROPDOWN: '.dropdown',
UL: 'ul:not(.dropdown-menu)',
LIST: 'ul:not(.dropdown-menu), ol:not(.dropdown-menu)',
FADE_CHILD: '> .nav-item .fade, > .fade',
ACTIVE: '.active',
ACTIVE_CHILD: '> .nav-item > .active, > .active',
@@ -79,11 +79,11 @@ var Tab = function ($) {
var target = void 0;
var previous = void 0;
var ulElement = $(this._element).closest(Selector.UL)[0];
var listElement = $(this._element).closest(Selector.LIST)[0];
var selector = Util.getSelectorFromElement(this._element);
if (ulElement) {
previous = $.makeArray($(ulElement).find(Selector.ACTIVE));
if (listElement) {
previous = $.makeArray($(listElement).find(Selector.ACTIVE));
previous = previous[previous.length - 1];
}
@@ -109,7 +109,7 @@ var Tab = function ($) {
target = $(selector)[0];
}
this._activate(this._element, ulElement);
this._activate(this._element, listElement);
var complete = function complete() {
var hiddenEvent = $.Event(Event.HIDDEN, {

2
js/dist/tab.js.map vendored

File diff suppressed because one or more lines are too long

22
js/dist/tooltip.js vendored
View File

@@ -69,7 +69,7 @@ var Tooltip = function ($) {
};
var HoverState = {
IN: 'in',
ACTIVE: 'active',
OUT: 'out'
};
@@ -88,7 +88,7 @@ var Tooltip = function ($) {
var ClassName = {
FADE: 'fade',
IN: 'in'
ACTIVE: 'active'
};
var Selector = {
@@ -168,7 +168,7 @@ var Tooltip = function ($) {
}
} else {
if ($(this.getTipElement()).hasClass(ClassName.IN)) {
if ($(this.getTipElement()).hasClass(ClassName.ACTIVE)) {
this._leave(null, this);
return;
}
@@ -249,7 +249,7 @@ var Tooltip = function ($) {
Util.reflow(tip);
this._tether.position();
$(tip).addClass(ClassName.IN);
$(tip).addClass(ClassName.ACTIVE);
var complete = function complete() {
var prevHoverState = _this._hoverState;
@@ -277,7 +277,7 @@ var Tooltip = function ($) {
var tip = this.getTipElement();
var hideEvent = $.Event(this.constructor.Event.HIDE);
var complete = function complete() {
if (_this2._hoverState !== HoverState.IN && tip.parentNode) {
if (_this2._hoverState !== HoverState.ACTIVE && tip.parentNode) {
tip.parentNode.removeChild(tip);
}
@@ -296,7 +296,7 @@ var Tooltip = function ($) {
return;
}
$(tip).removeClass(ClassName.IN);
$(tip).removeClass(ClassName.ACTIVE);
if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
@@ -323,7 +323,7 @@ var Tooltip = function ($) {
this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());
$tip.removeClass(ClassName.FADE).removeClass(ClassName.IN);
$tip.removeClass(ClassName.FADE).removeClass(ClassName.ACTIVE);
this.cleanupTether();
};
@@ -414,14 +414,14 @@ var Tooltip = function ($) {
context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
}
if ($(context.getTipElement()).hasClass(ClassName.IN) || context._hoverState === HoverState.IN) {
context._hoverState = HoverState.IN;
if ($(context.getTipElement()).hasClass(ClassName.ACTIVE) || context._hoverState === HoverState.ACTIVE) {
context._hoverState = HoverState.ACTIVE;
return;
}
clearTimeout(context._timeout);
context._hoverState = HoverState.IN;
context._hoverState = HoverState.ACTIVE;
if (!context.config.delay || !context.config.delay.show) {
context.show();
@@ -429,7 +429,7 @@ var Tooltip = function ($) {
}
context._timeout = setTimeout(function () {
if (context._hoverState === HoverState.IN) {
if (context._hoverState === HoverState.ACTIVE) {
context.show();
}
}, context.config.delay.show);

File diff suppressed because one or more lines are too long