Fix: Case where active element would stay visible on season view

pull/16/head
Juraj Nyíri 4 years ago
parent 4bf89dd61d
commit 858ea0a11b

@ -19887,6 +19887,9 @@ class PlexMeetsHomeAssistant extends HTMLElement {
} }
}; };
this.minimizeAll = () => { this.minimizeAll = () => {
if (this.activeMovieElem) {
this.activeMovieElem.style.display = `block`;
}
this.activeMovieElem = undefined; this.activeMovieElem = undefined;
for (let i = 0; i < this.movieElems.length; i += 1) { for (let i = 0; i < this.movieElems.length; i += 1) {
if (parseInt(this.movieElems[i].style.width, 10) > CSS_STYLE.width) { if (parseInt(this.movieElems[i].style.width, 10) > CSS_STYLE.width) {
@ -20073,6 +20076,11 @@ class PlexMeetsHomeAssistant extends HTMLElement {
} }
seasonElem.dataset.clicked = 'true'; seasonElem.dataset.clicked = 'true';
this.activeMovieElem.style.top = `${top - 1000}px`; this.activeMovieElem.style.top = `${top - 1000}px`;
setTimeout(() => {
if (this.activeMovieElem) {
this.activeMovieElem.style.display = 'none';
}
}, 500);
this.scrollDownInactiveSeasons(); this.scrollDownInactiveSeasons();
seasonContainer.style.top = `${-CSS_STYLE.expandedHeight}px`; seasonContainer.style.top = `${-CSS_STYLE.expandedHeight}px`;
seasonElem.style.width = `${CSS_STYLE.expandedWidth}px`; seasonElem.style.width = `${CSS_STYLE.expandedWidth}px`;
@ -20161,7 +20169,12 @@ class PlexMeetsHomeAssistant extends HTMLElement {
seasonContainer.style.top = `${seasonContainer.dataset.top}px`; seasonContainer.style.top = `${seasonContainer.dataset.top}px`;
this.minimizeSeasons(); this.minimizeSeasons();
this.hideEpisodes(); this.hideEpisodes();
this.activeMovieElem.style.display = `block`;
setTimeout(() => {
if (this.activeMovieElem) {
this.activeMovieElem.style.top = `${top + 16}px`; this.activeMovieElem.style.top = `${top + 16}px`;
}
}, 10);
if (this.detailElem && this.detailElem.children[1]) { if (this.detailElem && this.detailElem.children[1]) {
const { year } = this.detailElem.children[1].dataset; const { year } = this.detailElem.children[1].dataset;
if (year) { if (year) {

@ -396,6 +396,10 @@ class PlexMeetsHomeAssistant extends HTMLElement {
}; };
minimizeAll = (): void => { minimizeAll = (): void => {
if (this.activeMovieElem) {
this.activeMovieElem.style.display = `block`;
}
this.activeMovieElem = undefined; this.activeMovieElem = undefined;
for (let i = 0; i < this.movieElems.length; i += 1) { for (let i = 0; i < this.movieElems.length; i += 1) {
if (parseInt(this.movieElems[i].style.width, 10) > CSS_STYLE.width) { if (parseInt(this.movieElems[i].style.width, 10) > CSS_STYLE.width) {
@ -603,6 +607,11 @@ class PlexMeetsHomeAssistant extends HTMLElement {
seasonElem.dataset.clicked = 'true'; seasonElem.dataset.clicked = 'true';
this.activeMovieElem.style.top = `${top - 1000}px`; this.activeMovieElem.style.top = `${top - 1000}px`;
setTimeout(() => {
if (this.activeMovieElem) {
this.activeMovieElem.style.display = 'none';
}
}, 500);
this.scrollDownInactiveSeasons(); this.scrollDownInactiveSeasons();
@ -705,7 +714,13 @@ class PlexMeetsHomeAssistant extends HTMLElement {
seasonContainer.style.top = `${seasonContainer.dataset.top}px`; seasonContainer.style.top = `${seasonContainer.dataset.top}px`;
this.minimizeSeasons(); this.minimizeSeasons();
this.hideEpisodes(); this.hideEpisodes();
this.activeMovieElem.style.display = `block`;
setTimeout(() => {
if (this.activeMovieElem) {
this.activeMovieElem.style.top = `${top + 16}px`; this.activeMovieElem.style.top = `${top + 16}px`;
}
}, 10);
if (this.detailElem && (this.detailElem.children[1] as HTMLElement)) { if (this.detailElem && (this.detailElem.children[1] as HTMLElement)) {
const { year } = (this.detailElem.children[1] as HTMLElement).dataset; const { year } = (this.detailElem.children[1] as HTMLElement).dataset;
if (year) { if (year) {

Loading…
Cancel
Save