| 315 | 315 | |
| 316 | 316 | // Configure toast library: |
| 317 | 317 | toastr.options = { |
| 318 | 318 | 'closeButton': false, |
| 319 | 319 | 'progressBar': false, |
| 320 | 320 | 'showDuration': 250, |
| 321 | 321 | 'hideDuration': 250, |
| 322 | 322 | 'timeOut': 4000, |
| 323 | 323 | 'extendedTimeOut': 10000, |
| 324 | 324 | 'showEasing': 'linear', |
| 325 | 325 | 'hideEasing': 'linear', |
| 326 | 326 | 'showMethod': 'fadeIn', |
| 327 | 327 | 'hideMethod': 'fadeOut', |
| 328 | 328 | 'escapeHtml': true, |
| 329 | | -}; |
| 329 | + onHidden: function () { |
| 330 | | - |
| 330 | + // 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 |
| 331 | | - |
| 331 | + // so the toasts still show up inside there. |
| 332 | | -toastr.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 though |
| 333 | + }, |
| 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`); |
| 337 | | - |
| 337 | + }, |
| 338 | | -toastr.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 | }; |
| 343 | 339 | |
| 344 | 340 | // Allow target="_blank" in links |