mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-04-01 12:50:32 +02:00
Fix double transition of loader backdrop
This commit is contained in:
parent
5c318cd3f3
commit
5a8973d12a
@ -23,26 +23,23 @@ export function showLoader() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function hideLoader() {
|
export async function hideLoader() {
|
||||||
|
// Yoink preloader entirely; it only exists to cover up unstyled content while loading JS
|
||||||
|
// If it's present, we remove it once and then it's gone.
|
||||||
|
yoinkPreloader();
|
||||||
|
|
||||||
if (!loaderPopup) {
|
if (!loaderPopup) {
|
||||||
console.warn('There is no loader showing to hide');
|
console.warn('There is no loader showing to hide');
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
//Sets up a 2-step animation. Spinner blurs/fades out, and then the loader shadow does the same.
|
//Sets up a 2-step animation. Spinner blurs/fades out, and then the loader shadow does the same (by utilizing the popup closing transition)
|
||||||
$('#load-spinner').on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function () {
|
$('#load-spinner').on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function () {
|
||||||
$(`#${ELEMENT_ID}`)
|
$(`#${ELEMENT_ID}`).remove();
|
||||||
//only fade out the spinner and replace with login screen
|
loaderPopup.complete(POPUP_RESULT.AFFIRMATIVE).then(() => {
|
||||||
.animate({ opacity: 0 }, 300, function () {
|
loaderPopup = null;
|
||||||
// Yoink preloader entirely; it only exists to cover up unstyled content while loading JS
|
resolve();
|
||||||
// If it's present, we remove it once and then it's gone.
|
});
|
||||||
yoinkPreloader();
|
|
||||||
$(`#${ELEMENT_ID}`).remove();
|
|
||||||
loaderPopup.complete(POPUP_RESULT.AFFIRMATIVE).then(() => {
|
|
||||||
loaderPopup = null;
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#load-spinner')
|
$('#load-spinner')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user