mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Correct TV mode slideshow
This commit is contained in:
parent
e32fe240b7
commit
71f12dc360
1 changed files with 10 additions and 8 deletions
|
@ -145,10 +145,13 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
if (options.interactive) {
|
html += '<div class="slideshowSwiperContainer"><div class="swiper-wrapper"></div></div>';
|
||||||
|
|
||||||
|
if (options.interactive && !layoutManager.tv) {
|
||||||
|
console.warn(layoutManager.tv);
|
||||||
|
console.warn("Interactive");
|
||||||
var actionButtonsOnTop = layoutManager.mobile;
|
var actionButtonsOnTop = layoutManager.mobile;
|
||||||
|
|
||||||
html += '<div class="slideshowSwiperContainer"><div class="swiper-wrapper"></div></div>';
|
|
||||||
|
|
||||||
html += getIcon('keyboard_arrow_left', 'btnSlideshowPrevious slideshowButton hide-mouse-idle-tv', false);
|
html += getIcon('keyboard_arrow_left', 'btnSlideshowPrevious slideshowButton hide-mouse-idle-tv', false);
|
||||||
html += getIcon('keyboard_arrow_right', 'btnSlideshowNext slideshowButton hide-mouse-idle-tv', false);
|
html += getIcon('keyboard_arrow_right', 'btnSlideshowNext slideshowButton hide-mouse-idle-tv', false);
|
||||||
|
@ -185,7 +188,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
||||||
|
|
||||||
dialog.innerHTML = html;
|
dialog.innerHTML = html;
|
||||||
|
|
||||||
if (options.interactive) {
|
if (options.interactive && !layoutManager.tv) {
|
||||||
dialog.querySelector('.btnSlideshowExit').addEventListener('click', function (e) {
|
dialog.querySelector('.btnSlideshowExit').addEventListener('click', function (e) {
|
||||||
dialogHelper.close(dialog);
|
dialogHelper.close(dialog);
|
||||||
});
|
});
|
||||||
|
@ -217,9 +220,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
||||||
|
|
||||||
dialog.addEventListener('close', onDialogClosed);
|
dialog.addEventListener('close', onDialogClosed);
|
||||||
|
|
||||||
if (options.interactive) {
|
loadSwiper(dialog, options);
|
||||||
loadSwiper(dialog, options);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -257,10 +258,10 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
||||||
|
|
||||||
require(['swiper'], function (Swiper) {
|
require(['swiper'], function (Swiper) {
|
||||||
swiperInstance = new Swiper(dialog.querySelector('.slideshowSwiperContainer'), {
|
swiperInstance = new Swiper(dialog.querySelector('.slideshowSwiperContainer'), {
|
||||||
// Optional parameters
|
|
||||||
direction: 'horizontal',
|
direction: 'horizontal',
|
||||||
|
// Loop is disabled due to the virtual slides option not supporting it.
|
||||||
loop: false,
|
loop: false,
|
||||||
autoplay: options.interactive ? false : true,
|
autoplay: !options.interactive,
|
||||||
keyboard: {
|
keyboard: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
|
@ -273,6 +274,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
||||||
nextEl: '.btnSlideshowNext',
|
nextEl: '.btnSlideshowNext',
|
||||||
prevEl: '.btnSlideshowPrevious'
|
prevEl: '.btnSlideshowPrevious'
|
||||||
},
|
},
|
||||||
|
// Virtual slides reduce memory consumption for large libraries while allowing preloading of images;
|
||||||
virtual: {
|
virtual: {
|
||||||
slides: slides,
|
slides: slides,
|
||||||
cache: true,
|
cache: true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue