Merge pull request #1903 from dmitrylyzo/return-of-the-scrollbar

Return permanent scrollbar
This commit is contained in:
Bill Thornton 2020-11-21 15:28:08 -05:00 committed by GitHub
commit f3d1b77058
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 49 additions and 31 deletions

View file

@ -105,13 +105,6 @@ function tryRemoveElement(elem) {
});
}
function hidePrePlaybackPage() {
const animatedPage = document.querySelector('.page:not(.hide)');
animatedPage.classList.add('hide');
// At this point, we must hide the scrollbar placeholder, so it's not being displayed while the item is being loaded
document.body.classList.remove('force-scroll');
}
function zoomIn(elem) {
return new Promise(resolve => {
const duration = 240;
@ -678,6 +671,7 @@ function tryRemoveElement(elem) {
destroyFlvPlayer(this);
appRouter.setTransparency('none');
document.body.classList.remove('hide-scroll');
const videoElement = this.#mediaElement;
@ -1348,7 +1342,8 @@ function tryRemoveElement(elem) {
this.#mediaElement = videoElement;
if (options.fullscreen) {
hidePrePlaybackPage();
// At this point, we must hide the scrollbar placeholder, so it's not being displayed while the item is being loaded
document.body.classList.add('hide-scroll');
}
// don't animate on smart tv's, too slow
@ -1361,8 +1356,9 @@ function tryRemoveElement(elem) {
}
});
} else {
// we need to hide scrollbar when starting playback from page with animated background
if (options.fullscreen) {
hidePrePlaybackPage();
document.body.classList.add('hide-scroll');
}
return Promise.resolve(dlg.querySelector('video'));