1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update components

This commit is contained in:
Luke Pulverenti 2016-02-01 12:52:23 -05:00
parent 3e156cda5b
commit e1420ddb93
4 changed files with 33 additions and 7 deletions

View file

@ -87,6 +87,9 @@ define(['paperdialoghelper', 'inputManager', 'connectionManager', 'browser', 'cs
initialSlide: options.startIndex || 0
});
swiperInstance.on('onLazyImageLoad', onSlideChangeStart);
swiperInstance.on('onLazyImageReady', onSlideChangeEnd);
if (browser.mobile) {
pause();
} else {
@ -104,12 +107,22 @@ define(['paperdialoghelper', 'inputManager', 'connectionManager', 'browser', 'cs
});
}
function onSlideChangeStart(swiper, slide, image) {
slide.querySelector('paper-spinner').active = true;
}
function onSlideChangeEnd(swiper, slide, image) {
slide.querySelector('paper-spinner').active = false;
}
function getSwiperSlideHtmlFromSlide(item) {
var html = '';
html += '<div class="swiper-slide">';
html += '<img data-src="' + item.imageUrl + '" class="swiper-lazy">';
//html += '<paper-spinner class="swiper-lazy-preloader"></paper-spinner>';
html += '<paper-spinner></paper-spinner>';
if (item.title || item.subtitle) {
html += '<div class="slideText">';
html += '<div class="slideTextInner">';
@ -184,6 +197,8 @@ define(['paperdialoghelper', 'inputManager', 'connectionManager', 'browser', 'cs
var swiper = swiperInstance;
if (swiper) {
swiper.off('onLazyImageLoad');
swiper.off('onLazyImageReady');
swiper.destroy(true, true);
swiperInstance = null;
}