diff options
author | Mark Otto <markdotto@gmail.com> | 2017-04-02 05:18:29 +0300 |
---|---|---|
committer | Mark Otto <markdotto@gmail.com> | 2017-04-02 05:18:29 +0300 |
commit | 49b6cf845d3d3bf49197a529548489f9a1a76709 (patch) | |
tree | 725316258a4fbd311fc53ece9218e0d35e7ae827 /js/dist/collapse.js | |
parent | 5142de7e592abc0a791ea3465616795c91219bcc (diff) |
grunt
Diffstat (limited to 'js/dist/collapse.js')
-rw-r--r-- | js/dist/collapse.js | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/js/dist/collapse.js b/js/dist/collapse.js index 9826e2d529..6e570b890d 100644 --- a/js/dist/collapse.js +++ b/js/dist/collapse.js @@ -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(); } |