diff options
| author | GeoSot <[email protected]> | 2021-12-13 02:17:03 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2022-01-30 18:01:09 +0200 |
| commit | 7f04f84bf8562f2d8456649ee3cf78d181b52875 (patch) | |
| tree | 282d25efe8579b5999a14acf353507eaa5475422 /js/src | |
| parent | 5f1c542d677add524c94054ba8583269d81d87d0 (diff) | |
| download | bootstrap-7f04f84bf8562f2d8456649ee3cf78d181b52875.tar.xz bootstrap-7f04f84bf8562f2d8456649ee3cf78d181b52875.zip | |
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 efc3f2be3..f63630409 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() { |
