}
const ClassName = {
- FADE : 'fade',
- HIDE : 'hide',
- SHOW : 'show'
+ FADE : 'fade',
+ HIDE : 'hide',
+ SHOW : 'show',
+ SHOWING : 'showing'
}
const DefaultType = {
}
const complete = () => {
+ this._element.classList.remove(ClassName.SHOWING)
+ this._element.classList.add(ClassName.SHOW)
+
$(this._element).trigger(Event.SHOWN)
if (this._config.autohide) {
}
}
- 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)
_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)
.toast {
- display: none;
max-width: $toast-max-width;
overflow: hidden; // cheap rounded corners on nested items
font-size: $toast-font-size; // knock it down to 14px
border-radius: $toast-border-radius;
box-shadow: $toast-box-shadow;
backdrop-filter: blur(10px);
+ opacity: 0;
+ .toast {
margin-top: $toast-padding-x;
}
+ &.showing {
+ opacity: 1;
+ }
+
&.show {
display: block;
+ opacity: 1;
+ }
+
+ &.hide {
+ display: none;
}
}