1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Clean backdrops when tab is not selected

This commit is contained in:
Guillermo Fernandez 2023-10-02 20:17:23 +02:00
parent f563fce5a5
commit d5d2561979

View file

@ -37,8 +37,11 @@ class Backdrop {
parent.appendChild(backdropImage);
if (!enableAnimation()) {
if (existingBackdropImage?.parentNode) {
existingBackdropImage.parentNode.removeChild(existingBackdropImage);
if (existingBackdropImage) {
const backdropContainer = getBackdropContainer();
while (backdropContainer.childNodes.length > 1) {
backdropContainer.removeChild(backdropContainer.firstChild);
}
}
internalBackdrop(true);
return;
@ -51,8 +54,11 @@ class Backdrop {
if (backdropImage === self.currentAnimatingElement) {
self.currentAnimatingElement = null;
}
if (existingBackdropImage?.parentNode) {
existingBackdropImage.parentNode.removeChild(existingBackdropImage);
if (existingBackdropImage) {
const backdropContainer = getBackdropContainer();
while (backdropContainer.childNodes.length > 1) {
backdropContainer.removeChild(backdropContainer.firstChild);
}
}
};