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

View File

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

View File

@ -150,16 +150,21 @@ export default function () {
const elem = document.querySelector('.logoScreenSaver'); const elem = document.querySelector('.logoScreenSaver');
if (elem) { if (elem) {
const onAnimationFinish = function () { return new Promise((resolve) => {
elem.parentNode.removeChild(elem); const onAnimationFinish = function () {
}; elem.parentNode.removeChild(elem);
resolve();
};
if (elem.animate) { if (elem.animate) {
const animation = fadeOut(elem, 1); const animation = fadeOut(elem, 1);
animation.onfinish = onAnimationFinish; animation.onfinish = onAnimationFinish;
} else { } else {
onAnimationFinish(); onAnimationFinish();
} }
});
} }
return Promise.resolve();
}; };
} }