mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
Sync button state with actual autoplay state
This commit is contained in:
parent
a87c4d97a0
commit
baea3593a5
@ -198,6 +198,20 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onAutoplayStart() {
|
||||||
|
var btnSlideshowPause = dlg.querySelector('.btnSlideshowPause i');
|
||||||
|
if (btnSlideshowPause) {
|
||||||
|
btnSlideshowPause.innerHTML = "pause";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onAutoplayStop() {
|
||||||
|
var btnSlideshowPause = dlg.querySelector('.btnSlideshowPause i');
|
||||||
|
if (btnSlideshowPause) {
|
||||||
|
btnSlideshowPause.innerHTML = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function loadSwiper(dlg) {
|
function loadSwiper(dlg) {
|
||||||
|
|
||||||
if (currentOptions.slides) {
|
if (currentOptions.slides) {
|
||||||
@ -225,6 +239,9 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
|||||||
speed: 240
|
speed: 240
|
||||||
});
|
});
|
||||||
|
|
||||||
|
swiperInstance.on('autoplayStart', onAutoplayStart);
|
||||||
|
swiperInstance.on('autoplayStop', onAutoplayStop);
|
||||||
|
|
||||||
if (layoutManager.mobile) {
|
if (layoutManager.mobile) {
|
||||||
pause();
|
pause();
|
||||||
} else {
|
} else {
|
||||||
@ -336,24 +353,12 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
|
|||||||
}
|
}
|
||||||
|
|
||||||
function play() {
|
function play() {
|
||||||
|
|
||||||
var btnSlideshowPause = dlg.querySelector('.btnSlideshowPause i');
|
|
||||||
if (btnSlideshowPause) {
|
|
||||||
btnSlideshowPause.innerHTML = "pause";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (swiperInstance.autoplay) {
|
if (swiperInstance.autoplay) {
|
||||||
swiperInstance.autoplay.start();
|
swiperInstance.autoplay.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function pause() {
|
function pause() {
|
||||||
|
|
||||||
var btnSlideshowPause = dlg.querySelector('.btnSlideshowPause i');
|
|
||||||
if (btnSlideshowPause) {
|
|
||||||
btnSlideshowPause.innerHTML = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (swiperInstance.autoplay) {
|
if (swiperInstance.autoplay) {
|
||||||
swiperInstance.autoplay.stop();
|
swiperInstance.autoplay.stop();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user