Fix permanent scrollbar for screensaver

This commit is contained in:
Dmitry Lyzo 2020-10-31 22:39:30 +03:00
parent 3a692f4ed2
commit 517b69550e
4 changed files with 25 additions and 10 deletions

View File

@ -0,0 +1,4 @@
/* own "noScroll" class to avoid conflicts and the need for a scrollbar manager */
.screensaver-noScroll {
overflow: hidden !important;
}

View File

@ -3,6 +3,7 @@ import playbackManager from 'playbackManager';
import pluginManager from 'pluginManager';
import inputManager from 'inputManager';
import * as userSettings from 'userSettings';
import 'css!./screensavermanager.css';
function getMinIdleTime() {
// Returns the minimum amount of idle time required before the screen saver can be displayed
@ -52,6 +53,8 @@ function ScreenSaverManager() {
console.debug('Showing screensaver ' + screensaver.name);
document.body.classList.add('screensaver-noScroll');
screensaver.show();
activeScreenSaver = screensaver;
@ -69,7 +72,9 @@ function ScreenSaverManager() {
function hide() {
if (activeScreenSaver) {
console.debug('Hiding screensaver');
activeScreenSaver.hide();
activeScreenSaver.hide().then(() => {
document.body.classList.remove('screensaver-noScroll');
});
activeScreenSaver = null;
}

View File

@ -42,6 +42,7 @@ class BackdropScreensaver {
this.currentSlideshow.hide();
this.currentSlideshow = null;
}
return Promise.resolve();
}
}
/* eslint-enable indent */

View File

@ -150,8 +150,10 @@ export default function () {
const elem = document.querySelector('.logoScreenSaver');
if (elem) {
return new Promise((resolve) => {
const onAnimationFinish = function () {
elem.parentNode.removeChild(elem);
resolve();
};
if (elem.animate) {
@ -160,6 +162,9 @@ export default function () {
} else {
onAnimationFinish();
}
});
}
return Promise.resolve();
};
}