mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
support headroom with guide
This commit is contained in:
parent
937b1a7a7c
commit
ff79304dee
70 changed files with 115 additions and 88 deletions
|
@ -1,4 +1,28 @@
|
|||
define(['tvguide', 'embyRouter'], function (tvguide, embyRouter) {
|
||||
define(['tvguide', 'events'], function (tvguide, events) {
|
||||
|
||||
function onGuideLoaded() {
|
||||
|
||||
var context = this.options.element;
|
||||
|
||||
require(["headroom"], function () {
|
||||
|
||||
// construct an instance of Headroom, passing the element
|
||||
var headroom = new Headroom(context.querySelector('.tvGuideHeader'), {
|
||||
// or scroll tolerance per direction
|
||||
scroller: context.querySelector('.guideVerticalScroller'),
|
||||
|
||||
onPin: function () {
|
||||
context.classList.remove('headroomUnpinned');
|
||||
},
|
||||
// callback when unpinned, `this` is headroom object
|
||||
onUnpin: function () {
|
||||
context.classList.add('headroomUnpinned');
|
||||
}
|
||||
});
|
||||
// initialise
|
||||
headroom.init();
|
||||
});
|
||||
}
|
||||
|
||||
window.LiveTvPage.initGuideTab = function (page, tabContent) {
|
||||
|
||||
|
@ -6,15 +30,14 @@
|
|||
|
||||
window.LiveTvPage.renderGuideTab = function (page, tabContent) {
|
||||
|
||||
if (page.guideInstance) {
|
||||
if (LibraryBrowser.needsRefresh(tabContent)) {
|
||||
page.guideInstance.refresh();
|
||||
}
|
||||
} else {
|
||||
if (!page.guideInstance) {
|
||||
|
||||
page.guideInstance = new tvguide({
|
||||
element: tabContent,
|
||||
enableHeadRoom: true
|
||||
element: tabContent
|
||||
});
|
||||
|
||||
events.on(page.guideInstance, 'load', onGuideLoaded);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue