mirror of https://github.com/twbs/bootstrap.git
simplify toggle
This commit is contained in:
parent
3533e2d637
commit
d130b00cad
|
@ -124,18 +124,7 @@ class Dropdown extends BaseComponent {
|
||||||
// Public
|
// Public
|
||||||
|
|
||||||
toggle() {
|
toggle() {
|
||||||
if (isDisabled(this._element)) {
|
return this._isShown() ? this.hide() : this.show()
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const isActive = this._isShown()
|
|
||||||
|
|
||||||
if (isActive) {
|
|
||||||
this.hide()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
this.show()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
|
|
Loading…
Reference in New Issue