mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
update toaster template class and fix toast timeout
This commit is contained in:
@@ -20,11 +20,11 @@ function pwgToaster(info) {
|
|||||||
template.find('.toast_icon').addClass(info.icon === 'success' ? 'icon-ok' : 'icon-cancel');
|
template.find('.toast_icon').addClass(info.icon === 'success' ? 'icon-ok' : 'icon-cancel');
|
||||||
template.addClass(info.icon === 'success' ? info.icon : 'error');
|
template.addClass(info.icon === 'success' ? info.icon : 'error');
|
||||||
|
|
||||||
template.removeClass('template');
|
template.removeClass('template-pwg-toaster');
|
||||||
template.appendTo('#pwg_toaster');
|
template.appendTo('#pwg_toaster');
|
||||||
|
|
||||||
const time = info.time ?? 3600;
|
const time = info.time ?? 3600;
|
||||||
setInterval(() => {
|
setTimeout(() => {
|
||||||
template.fadeOut(() => {
|
template.fadeOut(() => {
|
||||||
template.remove();
|
template.remove();
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{combine_script id='toaster_js' load='async' require='jquery' path='themes/standard_pages/js/toaster.js'}
|
{combine_script id='toaster_js' load='async' require='jquery' path='themes/standard_pages/js/toaster.js'}
|
||||||
{html_style}
|
{html_style}
|
||||||
.toast.template {
|
.toast.template-pwg-toaster {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
}
|
}
|
||||||
{/html_style}
|
{/html_style}
|
||||||
<div class="toaster" id="pwg_toaster">
|
<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>
|
<i class="toast_icon"></i>
|
||||||
<p class="toast_text"></p>
|
<p class="toast_text"></p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user