diff --git a/public/script.js b/public/script.js index 257c60c68..699b71ac0 100644 --- a/public/script.js +++ b/public/script.js @@ -315,30 +315,26 @@ await new Promise((resolve) => { // Configure toast library: toastr.options = { - 'closeButton': false, - 'progressBar': false, - 'showDuration': 250, - 'hideDuration': 250, - 'timeOut': 4000, - 'extendedTimeOut': 10000, - 'showEasing': 'linear', - 'hideEasing': 'linear', - 'showMethod': 'fadeIn', - 'hideMethod': 'fadeOut', - 'escapeHtml': true, -}; - - -toastr.options.onHidden = () => { - // If we have any dialog still open, the last "hidden" toastr will remove the toastr-container. We need to keep it alive inside the dialog though - // so the toasts still show up inside there. - fixToastrForDialogs(); -}; - -toastr.options.onShown = function () { - const $toast = $(this); // 'this' refers to the toast element - const message = 'Click/Tap to close'; - $toast.attr('title', message); // Set tooltip to the notification message + closeButton: false, + progressBar: false, + showDuration: 250, + hideDuration: 250, + timeOut: 4000, + extendedTimeOut: 10000, + showEasing: 'linear', + hideEasing: 'linear', + showMethod: 'fadeIn', + hideMethod: 'fadeOut', + escapeHtml: true, + onHidden: function () { + // If we have any dialog still open, the last "hidden" toastr will remove the toastr-container. We need to keep it alive inside the dialog though + // so the toasts still show up inside there. + fixToastrForDialogs(); + }, + onShown: function () { + // Set tooltip to the notification message + $(this).attr('title', t`Tap to close`); + }, }; // Allow target="_blank" in links