mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-12 00:24:03 +02:00
Toast: provide isShown
method (#36272)
* feat(Toast): provide `isShown` method * Update site/content/docs/5.1/components/toasts.md Co-authored-by: Julien Déramond <julien.deramond@orange.com> Co-authored-by: Julien Déramond <julien.deramond@orange.com>
This commit is contained in:
@@ -100,7 +100,7 @@ class Toast extends BaseComponent {
|
||||
}
|
||||
|
||||
hide() {
|
||||
if (!this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
if (!this.isShown()) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -123,13 +123,17 @@ class Toast extends BaseComponent {
|
||||
dispose() {
|
||||
this._clearTimeout()
|
||||
|
||||
if (this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
if (this.isShown()) {
|
||||
this._element.classList.remove(CLASS_NAME_SHOW)
|
||||
}
|
||||
|
||||
super.dispose()
|
||||
}
|
||||
|
||||
isShown() {
|
||||
return this._element.classList.contains(CLASS_NAME_SHOW)
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
_maybeScheduleHide() {
|
||||
|
Reference in New Issue
Block a user