diff options
author | GeoSot <geo.sotis@gmail.com> | 2021-12-13 03:17:03 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2022-01-30 19:01:09 +0300 |
commit | 7f04f84bf8562f2d8456649ee3cf78d181b52875 (patch) | |
tree | 282d25efe8579b5999a14acf353507eaa5475422 /js/src | |
parent | 5f1c542d677add524c94054ba8583269d81d87d0 (diff) |
Dropdown: use only one check for shown state
Diffstat (limited to 'js/src')
-rw-r--r-- | js/src/dropdown.js | 8 |
1 files changed, 4 insertions, 4 deletions
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() { |