Combine all toastr settings into one object

449522c3aa7f4d4c8b66e7db60e2834fa532d96c

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

1 files changed, +20 -24Ignore whitespace
public/script.js+20 -24
@@ -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 () {
330330 // 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
331331 // so the toasts still show up inside there.
332toastr.options.onHidden = () => {332 fixToastrForDialogs();
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 though333 },
334 // so the toasts still show up inside there.334 onShown: function () {
335 fixToastrForDialogs();335 // Set tooltip to the notification message
336};336 $(this).attr('title', t`Tap to close`);
337337 },
338toastr.options.onShown = function () {
339 const $toast = $(this); // 'this' refers to the toast element
340 const message = 'Click/Tap to close';
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