From: GeoSot Date: Mon, 13 Dec 2021 00:17:03 +0000 (+0200) Subject: Dropdown: use only one check for shown state X-Git-Tag: v5.2.0-beta1~292 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f04f84bf8562f2d8456649ee3cf78d181b52875;p=thirdparty%2Fbootstrap.git Dropdown: use only one check for shown state --- diff --git a/js/src/dropdown.js b/js/src/dropdown.js index efc3f2be3c..f636304095 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -114,7 +114,7 @@ class Dropdown extends BaseComponent { } show() { - if (isDisabled(this._element) || this._isShown(this._menu)) { + if (isDisabled(this._element) || this._isShown()) { return } @@ -149,7 +149,7 @@ class Dropdown extends BaseComponent { } hide() { - if (isDisabled(this._element) || !this._isShown(this._menu)) { + if (isDisabled(this._element) || !this._isShown()) { return } @@ -233,8 +233,8 @@ class Dropdown extends BaseComponent { this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig) } - _isShown(element = this._element) { - return element.classList.contains(CLASS_NAME_SHOW) + _isShown() { + return this._menu.classList.contains(CLASS_NAME_SHOW) } _getPlacement() {