update toaster template class and fix toast timeout

This commit is contained in:
Linty
2025-08-26 14:30:24 +02:00
parent c616f17145
commit 93cc0e72a8
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -20,11 +20,11 @@ function pwgToaster(info) {
template.find('.toast_icon').addClass(info.icon === 'success' ? 'icon-ok' : 'icon-cancel');
template.addClass(info.icon === 'success' ? info.icon : 'error');
template.removeClass('template');
template.removeClass('template-pwg-toaster');
template.appendTo('#pwg_toaster');
const time = info.time ?? 3600;
setInterval(() => {
setTimeout(() => {
template.fadeOut(() => {
template.remove();
})
+2 -2
View File
@@ -1,6 +1,6 @@
{combine_script id='toaster_js' load='async' require='jquery' path='themes/standard_pages/js/toaster.js'}
{html_style}
.toast.template {
.toast.template-pwg-toaster {
display: none;
}
@@ -52,7 +52,7 @@
}
{/html_style}
<div class="toaster" id="pwg_toaster">
<div class="toast template" id="toast_template">
<div class="toast template-pwg-toaster" id="toast_template">
<i class="toast_icon"></i>
<p class="toast_text"></p>
</div>