mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-23 14:09:42 +00:00
lazy load gallery
This commit is contained in:
parent
9e1deff569
commit
430e293a14
@ -56,7 +56,7 @@
|
||||
<h3>Cast & Crew</h3>
|
||||
<p>I'm the collapsible content. By default I'm closed, but you can click the header to open me.</p>
|
||||
</div>
|
||||
<div data-role="collapsible" data-content-theme="a">
|
||||
<div data-role="collapsible" data-content-theme="a" id="galleryCollapsible">
|
||||
<h3>Gallery</h3>
|
||||
<div id="galleryContent"></div>
|
||||
</div>
|
||||
|
@ -3,9 +3,18 @@
|
||||
onPageShow: function () {
|
||||
|
||||
ItemDetailPage.reload();
|
||||
|
||||
$('#galleryCollapsible', this).on('expand', ItemDetailPage.onGalleryExpand);
|
||||
},
|
||||
|
||||
reload: function() {
|
||||
onPageHide: function () {
|
||||
|
||||
$('#galleryCollapsible', this).off('expand', ItemDetailPage.onGalleryExpand);
|
||||
|
||||
ItemDetailPage.item = null;
|
||||
},
|
||||
|
||||
reload: function () {
|
||||
var id = getParameterByName('id');
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
@ -15,6 +24,8 @@
|
||||
|
||||
renderItem: function (item) {
|
||||
|
||||
ItemDetailPage.item = item;
|
||||
|
||||
var page = $.mobile.activePage;
|
||||
|
||||
ItemDetailPage.item = item;
|
||||
@ -30,7 +41,6 @@
|
||||
ItemDetailPage.renderImage(item);
|
||||
ItemDetailPage.renderOverviewBlock(item);
|
||||
ItemDetailPage.renderScenes(item);
|
||||
ItemDetailPage.renderGallery(item);
|
||||
ItemDetailPage.renderMediaInfo(item);
|
||||
|
||||
$('#itemName', page).html(name);
|
||||
@ -265,6 +275,16 @@
|
||||
MediaPlayer.play([ItemDetailPage.item]);
|
||||
},
|
||||
|
||||
onGalleryExpand: function() {
|
||||
|
||||
if (ItemDetailPage.item) {
|
||||
|
||||
ItemDetailPage.renderGallery(ItemDetailPage.item);
|
||||
|
||||
$(this).off('expand', ItemDetailPage.onGalleryExpand);
|
||||
}
|
||||
},
|
||||
|
||||
renderGallery: function (item) {
|
||||
|
||||
var page = $.mobile.activePage;
|
||||
@ -353,4 +373,4 @@
|
||||
}
|
||||
};
|
||||
|
||||
$(document).on('pageshow', "#itemDetailPage", ItemDetailPage.onPageShow);
|
||||
$(document).on('pageshow', "#itemDetailPage", ItemDetailPage.onPageShow).on('pagehide', "#itemDetailPage", ItemDetailPage.onPageHide);
|
||||
|
Loading…
Reference in New Issue
Block a user