aboutsummaryrefslogtreecommitdiff
path: root/js/src/dropdown.js
diff options
context:
space:
mode:
authorGeoSot <[email protected]>2021-07-08 17:42:09 +0300
committerXhmikosR <[email protected]>2021-07-22 17:54:48 +0300
commitd130b00cad9552feb313cbd04486bd179b7295df (patch)
treed7e9668ec2353fa5473404090cf6a4fdd7835b13 /js/src/dropdown.js
parent3533e2d637d694b5b11a65c7911c3dc45d131e42 (diff)
downloadbootstrap-d130b00cad9552feb313cbd04486bd179b7295df.tar.xz
bootstrap-d130b00cad9552feb313cbd04486bd179b7295df.zip
simplify toggle
Diffstat (limited to 'js/src/dropdown.js')
-rw-r--r--js/src/dropdown.js13
1 files changed, 1 insertions, 12 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js
index 09414c97b..be561b128 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() {