diff --git a/js/src/toast.js b/js/src/toast.js index 8b81fe094..9f06a1c32 100644 --- a/js/src/toast.js +++ b/js/src/toast.js @@ -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) - } } /** diff --git a/site/content/docs/5.2/components/toasts.md b/site/content/docs/5.2/components/toasts.md index c8e1781d5..34a8ea82b 100644 --- a/site/content/docs/5.2/components/toasts.md +++ b/site/content/docs/5.2/components/toasts.md @@ -60,7 +60,7 @@ Click the button below to show a toast (positioned with our utilities in the low
Hello, world! This is a toast message.
-
+