Combine all toastr settings into one object

449522c3aa7f4d4c8b66e7db60e2834fa532d96c

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +17 -21Showing whitespace changes
public/script.js+17 -21
@@ -315,30 +315,26 @@ await new Promise((resolve) => {
315315
316316// Configure toast library:
317317toastr.options = {
318318 'closeButton': false,
319319 'progressBar': false,
320320 'showDuration': 250,
321321 'hideDuration': 250,
322322 'timeOut': 4000,
323323 'extendedTimeOut': 10000,
324324 'showEasing': 'linear',
325325 'hideEasing': 'linear',
326326 'showMethod': 'fadeIn',
327327 'hideMethod': 'fadeOut',
328328 'escapeHtml': true,
329-};
329+ onHidden: function () {
330-
331-
332-toastr.options.onHidden = () => {
333330 // 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
334331 // so the toasts still show up inside there.
335332 fixToastrForDialogs();
336-};
333+ },
337-
334+ onShown: function () {
338-toastr.options.onShown = function () {
335+ // Set tooltip to the notification message
339- const $toast = $(this); // 'this' refers to the toast element
336+ $(this).attr('title', t`Tap to close`);
340- const message = 'Click/Tap to close';
337+ },
341- $toast.attr('title', message); // Set tooltip to the notification message
342338};
343339
344340// Allow target="_blank" in links