2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-08 17:22:31 +03:00

Update toast.js & toasts.md

This commit is contained in:
XhmikosR
2021-08-01 11:30:23 +03:00
committed by GeoSot
parent aec75345c4
commit 5f97983bfd
2 changed files with 18 additions and 18 deletions
+17 -17
View File
@@ -194,7 +194,24 @@ class Toast extends BaseComponent {
this._timeout = null
}
_toggleProgressBar(time) {
const progressBarElement = SelectorEngine.findOne(CLASS_PROGRESS_BAR, this._element)
if (!progressBarElement) {
return
}
if (time) {
progressBarElement.classList.add('animated')
progressBarElement.style.animationDuration = `${time}ms`
return
}
progressBarElement.classList.remove('animated')
reflow(progressBarElement)
}
// Static
static jQueryInterface(config) {
return this.each(function () {
const data = Toast.getOrCreateInstance(this, config)
@@ -208,23 +225,6 @@ class Toast extends BaseComponent {
}
})
}
_toggleProgressBar(time) {
const progressBarElement = SelectorEngine.findOne(CLASS_PROGRESS_BAR, this._element)
if (!progressBarElement) {
return
}
if (time) {
progressBarElement.classList.add('animated')
progressBarElement.style.animationDuration = `${time}ms`
// reflow(progressBarElement)
return
}
progressBarElement.classList.remove('animated')
reflow(progressBarElement)
}
}
/**