From: GeoSot Date: Thu, 8 Jul 2021 14:42:09 +0000 (+0300) Subject: simplify toggle X-Git-Tag: v5.1.0~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d130b00cad9552feb313cbd04486bd179b7295df;p=thirdparty%2Fbootstrap.git simplify toggle --- diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 09414c97be..be561b1282 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -124,18 +124,7 @@ class Dropdown extends BaseComponent { // Public toggle() { - if (isDisabled(this._element)) { - return - } - - const isActive = this._isShown() - - if (isActive) { - this.hide() - return - } - - this.show() + return this._isShown() ? this.hide() : this.show() } show() {