simplify toggle

This commit is contained in:
GeoSot 2021-07-08 17:42:09 +03:00 committed by XhmikosR
parent 3533e2d637
commit d130b00cad
1 changed files with 1 additions and 12 deletions

View File

@ -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() {