mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-15 11:59:39 +03:00
simplify toggle
This commit is contained in:
+1
-12
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user