Update: movieElem relative at start

horizontal_scroll_2
Juraj Nyíri 3 years ago
parent 427c392d31
commit 2ee83a7f65

@ -21326,7 +21326,7 @@ style.textContent = css `
overflow: hidden; overflow: hidden;
border-radius: 5px; border-radius: 5px;
transition: 0.5s; transition: 0.5s;
position: absolute; position: relative;
z-index: 1; z-index: 1;
} }
.plexMeetsContainer { .plexMeetsContainer {
@ -22179,6 +22179,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.loadCustomStyles(); this.loadCustomStyles();
}; };
this.calculatePositions = () => { this.calculatePositions = () => {
// return; // temp
// todo: figure out why interval is needed here and do it properly // todo: figure out why interval is needed here and do it properly
const setLeftOffsetsInterval = setInterval(() => { const setLeftOffsetsInterval = setInterval(() => {
this.movieElems = this.getElementsByClassName('movieElem'); this.movieElems = this.getElementsByClassName('movieElem');
@ -22193,6 +22194,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.movieElems[i].dataset.left = this.movieElems[i].offsetLeft; this.movieElems[i].dataset.left = this.movieElems[i].offsetLeft;
this.movieElems[i].style.top = `${this.movieElems[i].offsetTop}px`; this.movieElems[i].style.top = `${this.movieElems[i].offsetTop}px`;
this.movieElems[i].dataset.top = this.movieElems[i].offsetTop; this.movieElems[i].dataset.top = this.movieElems[i].offsetTop;
this.movieElems[i].style.position = 'absolute';
} }
}, 100); }, 100);
}; };

@ -384,7 +384,7 @@ style.textContent = css`
overflow: hidden; overflow: hidden;
border-radius: 5px; border-radius: 5px;
transition: 0.5s; transition: 0.5s;
position: absolute; position: relative;
z-index: 1; z-index: 1;
} }
.plexMeetsContainer { .plexMeetsContainer {

@ -907,6 +907,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
}; };
calculatePositions = (): void => { calculatePositions = (): void => {
// return; // temp
// todo: figure out why interval is needed here and do it properly // todo: figure out why interval is needed here and do it properly
const setLeftOffsetsInterval = setInterval(() => { const setLeftOffsetsInterval = setInterval(() => {
this.movieElems = this.getElementsByClassName('movieElem'); this.movieElems = this.getElementsByClassName('movieElem');
@ -920,6 +921,7 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.movieElems[i].dataset.left = this.movieElems[i].offsetLeft; this.movieElems[i].dataset.left = this.movieElems[i].offsetLeft;
this.movieElems[i].style.top = `${this.movieElems[i].offsetTop}px`; this.movieElems[i].style.top = `${this.movieElems[i].offsetTop}px`;
this.movieElems[i].dataset.top = this.movieElems[i].offsetTop; this.movieElems[i].dataset.top = this.movieElems[i].offsetTop;
this.movieElems[i].style.position = 'absolute';
} }
}, 100); }, 100);
}; };

Loading…
Cancel
Save