diff options
author | GeoSot <geo.sotis@gmail.com> | 2021-07-22 18:13:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-22 18:13:13 +0300 |
commit | 41292a52570610dc312a775ae0491dc46f93a4fe (patch) | |
tree | ce8185d87fd969dac7d7cf39b1f03c43452c5e4e /js/src/toast.js | |
parent | e85a6ed77c92ee43cf23b5c6ce479dbd0100be66 (diff) |
Toasts: Change showing timings and classes to keep toast `display:none` by default (#33610)
Diffstat (limited to 'js/src/toast.js')
-rw-r--r-- | js/src/toast.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/js/src/toast.js b/js/src/toast.js index b6c9bdd792..9b3c0f7c8b 100644 --- a/js/src/toast.js +++ b/js/src/toast.js @@ -35,7 +35,7 @@ const EVENT_SHOW = `show${EVENT_KEY}` const EVENT_SHOWN = `shown${EVENT_KEY}` const CLASS_NAME_FADE = 'fade' -const CLASS_NAME_HIDE = 'hide' +const CLASS_NAME_HIDE = 'hide' // @deprecated - kept here only for backwards compatibility const CLASS_NAME_SHOW = 'show' const CLASS_NAME_SHOWING = 'showing' @@ -101,15 +101,14 @@ class Toast extends BaseComponent { const complete = () => { this._element.classList.remove(CLASS_NAME_SHOWING) - this._element.classList.add(CLASS_NAME_SHOW) - EventHandler.trigger(this._element, EVENT_SHOWN) this._maybeScheduleHide() } - this._element.classList.remove(CLASS_NAME_HIDE) + this._element.classList.remove(CLASS_NAME_HIDE) // @deprecated reflow(this._element) + this._element.classList.add(CLASS_NAME_SHOW) this._element.classList.add(CLASS_NAME_SHOWING) this._queueCallback(complete, this._element, this._config.animation) @@ -127,11 +126,13 @@ class Toast extends BaseComponent { } const complete = () => { - this._element.classList.add(CLASS_NAME_HIDE) + this._element.classList.add(CLASS_NAME_HIDE) // @deprecated + this._element.classList.remove(CLASS_NAME_SHOWING) + this._element.classList.remove(CLASS_NAME_SHOW) EventHandler.trigger(this._element, EVENT_HIDDEN) } - this._element.classList.remove(CLASS_NAME_SHOW) + this._element.classList.add(CLASS_NAME_SHOWING) this._queueCallback(complete, this._element, this._config.animation) } |