mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
more toasty edge case fixes
This commit is contained in:
@@ -313,7 +313,7 @@ await new Promise((resolve) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
showLoader();
|
//showLoader(); <-- must wait for poweruser (called from firstinit()), so moved it in there
|
||||||
|
|
||||||
// Configure toast library:
|
// Configure toast library:
|
||||||
toastr.options.escapeHtml = true; // Prevent raw HTML inserts
|
toastr.options.escapeHtml = true; // Prevent raw HTML inserts
|
||||||
@@ -990,6 +990,7 @@ async function firstLoadInit() {
|
|||||||
await initPresetManager();
|
await initPresetManager();
|
||||||
await getSystemMessages();
|
await getSystemMessages();
|
||||||
await getSettings();
|
await getSettings();
|
||||||
|
showLoader();
|
||||||
initKeyboard();
|
initKeyboard();
|
||||||
initDynamicStyles();
|
initDynamicStyles();
|
||||||
initTags();
|
initTags();
|
||||||
@@ -7595,8 +7596,6 @@ export async function getSettings() {
|
|||||||
// Apply theme toggles from power user settings
|
// Apply theme toggles from power user settings
|
||||||
applyPowerUserSettings();
|
applyPowerUserSettings();
|
||||||
|
|
||||||
toastr.options.positionClass = power_user.toastr_position; // Where to position the toast container
|
|
||||||
|
|
||||||
// Load character tags
|
// Load character tags
|
||||||
loadTagsSettings(settings);
|
loadTagsSettings(settings);
|
||||||
|
|
||||||
|
@@ -718,7 +718,6 @@ export function getTopmostModalLayer() {
|
|||||||
*/
|
*/
|
||||||
export function fixToastrForDialogs() {
|
export function fixToastrForDialogs() {
|
||||||
// Hacky way of getting toastr to actually display on top of the popup...
|
// Hacky way of getting toastr to actually display on top of the popup...
|
||||||
|
|
||||||
const dlg = Array.from(document.querySelectorAll('dialog[open]:not([closing])')).pop();
|
const dlg = Array.from(document.querySelectorAll('dialog[open]:not([closing])')).pop();
|
||||||
|
|
||||||
let toastContainer = document.getElementById('toast-container');
|
let toastContainer = document.getElementById('toast-container');
|
||||||
@@ -726,7 +725,15 @@ export function fixToastrForDialogs() {
|
|||||||
if (!toastContainer) {
|
if (!toastContainer) {
|
||||||
toastContainer = document.createElement('div');
|
toastContainer = document.createElement('div');
|
||||||
toastContainer.setAttribute('id', 'toast-container');
|
toastContainer.setAttribute('id', 'toast-container');
|
||||||
if (toastr.options.positionClass) toastContainer.classList.add(toastr.options.positionClass);
|
if (power_user.toastr_position) {
|
||||||
|
toastr.options.positionClass = (power_user.toastr_position);
|
||||||
|
} else {
|
||||||
|
console.warn('Did not find poweruser.toastr_position; defaulting to top center');
|
||||||
|
power_user.toastr_position = 'toast-top-center';
|
||||||
|
toastr.options.positionClass = (power_user.toastr_position);
|
||||||
|
$(`#toastr_position option[value=${power_user.toastr_position}]`).attr('selected', true);
|
||||||
|
}
|
||||||
|
//if (toastr.options.positionClass) toastContainer.classList.add(toastr.options.positionClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if toastr is already a child. If not, we need to move it inside this dialog.
|
// Check if toastr is already a child. If not, we need to move it inside this dialog.
|
||||||
|
Reference in New Issue
Block a user