mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #1229 from ferferga/scrollbar-placeholder
Keep scrollbar always present to avoid UI clipping
This commit is contained in:
commit
8f85ca24fb
4 changed files with 21 additions and 0 deletions
|
@ -120,3 +120,11 @@ div[data-role=page] {
|
||||||
.headroom--unpinned {
|
.headroom--unpinned {
|
||||||
transform: translateY(-100%);
|
transform: translateY(-100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.force-scroll {
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hide-scroll {
|
||||||
|
overflow-y: hidden;
|
||||||
|
}
|
||||||
|
|
|
@ -109,6 +109,8 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
|
||||||
function hidePrePlaybackPage() {
|
function hidePrePlaybackPage() {
|
||||||
let animatedPage = document.querySelector('.page:not(.hide)');
|
let animatedPage = document.querySelector('.page:not(.hide)');
|
||||||
animatedPage.classList.add('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) {
|
function zoomIn(elem) {
|
||||||
|
|
|
@ -137,6 +137,8 @@ define(['apphost', 'userSettings', 'browser', 'events', 'backdrop', 'globalize',
|
||||||
|
|
||||||
function onViewBeforeShow(e) {
|
function onViewBeforeShow(e) {
|
||||||
if (e.detail && e.detail.type === 'video-osd') {
|
if (e.detail && e.detail.type === 'video-osd') {
|
||||||
|
// This removes the space that the scrollbar takes while playing a video
|
||||||
|
document.body.classList.remove('force-scroll');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,6 +157,9 @@ define(['apphost', 'userSettings', 'browser', 'events', 'backdrop', 'globalize',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// This keeps the scrollbar always present in all pages, so we avoid clipping while switching between pages
|
||||||
|
// that need the scrollbar and pages that don't.
|
||||||
|
document.body.classList.add('force-scroll');
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('viewshow', onViewBeforeShow);
|
document.addEventListener('viewshow', onViewBeforeShow);
|
||||||
|
|
|
@ -438,6 +438,9 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
||||||
|
|
||||||
inputManager.off(window, onInputCommand);
|
inputManager.off(window, onInputCommand);
|
||||||
document.removeEventListener((window.PointerEvent ? 'pointermove' : 'mousemove'), onPointerMove);
|
document.removeEventListener((window.PointerEvent ? 'pointermove' : 'mousemove'), onPointerMove);
|
||||||
|
// Shows page scrollbar
|
||||||
|
document.body.classList.remove('hide-scroll');
|
||||||
|
document.body.classList.add('force-scroll');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -603,6 +606,9 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
||||||
*/
|
*/
|
||||||
self.show = function () {
|
self.show = function () {
|
||||||
createElements(options);
|
createElements(options);
|
||||||
|
// Hides page scrollbar
|
||||||
|
document.body.classList.remove('force-scroll');
|
||||||
|
document.body.classList.add('hide-scroll');
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue