1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-16 10:34:07 +02:00
This commit is contained in:
Mark Otto
2016-12-02 10:13:36 -08:00
parent e3a569f4f6
commit 3ec37d4a4d
24 changed files with 177 additions and 56 deletions

12
js/dist/collapse.js vendored
View File

@@ -103,7 +103,11 @@ var Collapse = function ($) {
Collapse.prototype.show = function show() {
var _this = this;
if (this._isTransitioning || $(this._element).hasClass(ClassName.ACTIVE)) {
if (this._isTransitioning) {
throw new Error('Collapse is transitioning');
}
if ($(this._element).hasClass(ClassName.ACTIVE)) {
return;
}
@@ -176,7 +180,11 @@ var Collapse = function ($) {
Collapse.prototype.hide = function hide() {
var _this2 = this;
if (this._isTransitioning || !$(this._element).hasClass(ClassName.ACTIVE)) {
if (this._isTransitioning) {
throw new Error('Collapse is transitioning');
}
if (!$(this._element).hasClass(ClassName.ACTIVE)) {
return;
}