1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-15 10:05:40 +02:00
This commit is contained in:
Mark Otto
2017-04-01 19:18:29 -07:00
parent 5142de7e59
commit 49b6cf845d
20 changed files with 105 additions and 116 deletions

14
js/dist/collapse.js vendored
View File

@@ -111,11 +111,7 @@ var Collapse = function ($) {
Collapse.prototype.show = function show() {
var _this = this;
if (this._isTransitioning) {
throw new Error('Collapse is transitioning');
}
if ($(this._element).hasClass(ClassName.SHOW)) {
if (this._isTransitioning || $(this._element).hasClass(ClassName.SHOW)) {
return;
}
@@ -188,11 +184,7 @@ var Collapse = function ($) {
Collapse.prototype.hide = function hide() {
var _this2 = this;
if (this._isTransitioning) {
throw new Error('Collapse is transitioning');
}
if (!$(this._element).hasClass(ClassName.SHOW)) {
if (this._isTransitioning || !$(this._element).hasClass(ClassName.SHOW)) {
return;
}
@@ -338,7 +330,7 @@ var Collapse = function ($) {
*/
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
if (/input|textarea/i.test(event.target.tagName)) {
if (!/input|textarea/i.test(event.target.tagName)) {
event.preventDefault();
}