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
+4
View File
@@ -0,0 +1,4 @@
/* own "noScroll" class to avoid conflicts and the need for a scrollbar manager */
.screensaver-noScroll {
overflow: hidden !important;
}
+6 -1
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;
}
@@ -42,6 +42,7 @@ class BackdropScreensaver {
this.currentSlideshow.hide();
this.currentSlideshow = null;
}
return Promise.resolve();
}
}
/* eslint-enable indent */
+14 -9
View File
@@ -150,16 +150,21 @@ export default function () {
const elem = document.querySelector('.logoScreenSaver');
if (elem) {
const onAnimationFinish = function () {
elem.parentNode.removeChild(elem);
};
return new Promise((resolve) => {
const onAnimationFinish = function () {
elem.parentNode.removeChild(elem);
resolve();
};
if (elem.animate) {
const animation = fadeOut(elem, 1);
animation.onfinish = onAnimationFinish;
} else {
onAnimationFinish();
}
if (elem.animate) {
const animation = fadeOut(elem, 1);
animation.onfinish = onAnimationFinish;
} else {
onAnimationFinish();
}
});
}
return Promise.resolve();
};
}