Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2018-12-06 15:53:01 +0300
committerJohann-S <johann.servoire@gmail.com>2018-12-10 12:38:11 +0300
commit1f4d7903db37de5f7efad455c307583cedf53b27 (patch)
treed3aaa2e378f486526c61b9be1df326297a57cde3 /js/src
parentfc15c4c4ce132e70eb67335dfe840c3f0a80dae4 (diff)
fix fade animation for toast
Diffstat (limited to 'js/src')
-rw-r--r--js/src/toast.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/js/src/toast.js b/js/src/toast.js
index 23d482d35f..471d11aebe 100644
--- a/js/src/toast.js
+++ b/js/src/toast.js
@@ -29,9 +29,10 @@ const Event = {
}
const ClassName = {
- FADE : 'fade',
- HIDE : 'hide',
- SHOW : 'show'
+ FADE : 'fade',
+ HIDE : 'hide',
+ SHOW : 'show',
+ SHOWING : 'showing'
}
const DefaultType = {
@@ -84,6 +85,9 @@ class Toast {
}
const complete = () => {
+ this._element.classList.remove(ClassName.SHOWING)
+ this._element.classList.add(ClassName.SHOW)
+
$(this._element).trigger(Event.SHOWN)
if (this._config.autohide) {
@@ -91,7 +95,8 @@ class Toast {
}
}
- this._element.classList.add(ClassName.SHOW)
+ this._element.classList.remove(ClassName.HIDE)
+ this._element.classList.add(ClassName.SHOWING)
if (this._config.animation) {
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
@@ -162,11 +167,11 @@ class Toast {
_close() {
const complete = () => {
+ this._element.classList.add(ClassName.HIDE)
$(this._element).trigger(Event.HIDDEN)
}
this._element.classList.remove(ClassName.SHOW)
-
if (this._config.animation) {
const transitionDuration = Util.getTransitionDurationFromElement(this._element)