mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Combine all toastr settings into one object
This commit is contained in:
@ -315,30 +315,26 @@ await new Promise((resolve) => {
|
|||||||
|
|
||||||
// Configure toast library:
|
// Configure toast library:
|
||||||
toastr.options = {
|
toastr.options = {
|
||||||
'closeButton': false,
|
closeButton: false,
|
||||||
'progressBar': false,
|
progressBar: false,
|
||||||
'showDuration': 250,
|
showDuration: 250,
|
||||||
'hideDuration': 250,
|
hideDuration: 250,
|
||||||
'timeOut': 4000,
|
timeOut: 4000,
|
||||||
'extendedTimeOut': 10000,
|
extendedTimeOut: 10000,
|
||||||
'showEasing': 'linear',
|
showEasing: 'linear',
|
||||||
'hideEasing': 'linear',
|
hideEasing: 'linear',
|
||||||
'showMethod': 'fadeIn',
|
showMethod: 'fadeIn',
|
||||||
'hideMethod': 'fadeOut',
|
hideMethod: 'fadeOut',
|
||||||
'escapeHtml': true,
|
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.
|
||||||
toastr.options.onHidden = () => {
|
fixToastrForDialogs();
|
||||||
// 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.
|
onShown: function () {
|
||||||
fixToastrForDialogs();
|
// Set tooltip to the notification message
|
||||||
};
|
$(this).attr('title', t`Tap to close`);
|
||||||
|
},
|
||||||
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
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Allow target="_blank" in links
|
// Allow target="_blank" in links
|
||||||
|
Reference in New Issue
Block a user