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
316// Configure toast library:316// Configure toast library:
317toastr.options = {317toastr.options = {
318 'closeButton': false,318 closeButton: false,
319 'progressBar': false,319 progressBar: false,
320 'showDuration': 250,320 showDuration: 250,
321 'hideDuration': 250,321 hideDuration: 250,
322 'timeOut': 4000,322 timeOut: 4000,
323 'extendedTimeOut': 10000,323 extendedTimeOut: 10000,
324 'showEasing': 'linear',324 showEasing: 'linear',
325 'hideEasing': 'linear',325 hideEasing: 'linear',
326 'showMethod': 'fadeIn',326 showMethod: 'fadeIn',
327 'hideMethod': 'fadeOut',327 hideMethod: 'fadeOut',
328 'escapeHtml': true,328 escapeHtml: true,
329};329 onHidden: function () {
330
331
332toastr.options.onHidden = () => {
333 // 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 though330 // 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
334 // so the toasts still show up inside there.331 // so the toasts still show up inside there.
335 fixToastrForDialogs();332 fixToastrForDialogs();
336};333 },
337334 onShown: function () {
338toastr.options.onShown = function () {335 // Set tooltip to the notification message
339 const $toast = $(this); // 'this' refers to the toast element336 $(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
342};338};
343339
344// Allow target="_blank" in links340// Allow target="_blank" in links