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

update playlist

This commit is contained in:
Luke Pulverenti 2016-05-19 15:57:30 -04:00
parent b5883925e7
commit 619cad7f41
3 changed files with 17 additions and 45 deletions

View file

@ -413,24 +413,17 @@
// $(".playlist", page).html(html).lazyChildren();
//});
var playlistOpen = isPlaylistOpen(context);
html += libraryBrowser.getListViewHtml({
items: MediaController.playlist(),
smallIcon: true
});
if (playlistOpen) {
html += libraryBrowser.getListViewHtml({
items: MediaController.playlist(),
smallIcon: true
});
playlistNeedsRefresh = false;
}
playlistNeedsRefresh = false;
var deps = [];
if (playlistOpen) {
deps.push('paper-icon-item');
deps.push('paper-item-body');
}
deps.push('paper-icon-item');
deps.push('paper-item-body');
require(deps, function () {
@ -438,19 +431,16 @@
itemsContainer.innerHTML = html;
if (playlistOpen) {
var index = MediaController.currentPlaylistIndex();
var index = MediaController.currentPlaylistIndex();
if (index != -1) {
if (index != -1) {
var item = itemsContainer.querySelectorAll('.listItem')[index];
if (item) {
var img = item.querySelector('.listviewImage');
var item = itemsContainer.querySelectorAll('.listItem')[index];
if (item) {
var img = item.querySelector('.listviewImage');
img.classList.remove('lazy');
img.classList.add('playlistIndexIndicatorImage');
}
img.classList.remove('lazy');
img.classList.add('playlistIndexIndicatorImage');
}
}
@ -458,10 +448,6 @@
});
}
function isPlaylistOpen(context) {
return libraryBrowser.selectedTab(context.querySelector('.libraryViewNav')) == 2;
}
function onStateChanged(e, state) {
if (e.type == 'positionchange') {
@ -485,11 +471,7 @@
onStateChanged.call(player, e, state);
if (isPlaylistOpen(dlg)) {
loadPlaylist(dlg);
} else {
playlistNeedsRefresh = true;
}
loadPlaylist(dlg);
}
function onPlaybackStopped(e, state) {
@ -500,11 +482,7 @@
onStateChanged.call(player, e, {});
if (isPlaylistOpen(dlg)) {
loadPlaylist(dlg);
} else {
playlistNeedsRefresh = true;
}
loadPlaylist(dlg);
}
function releaseCurrentPlayer() {
@ -824,6 +802,7 @@
libraryBrowser.configurePaperLibraryTabs(ownerView, mdlTabs, ownerView.querySelectorAll('.pageTabContent'));
mdlTabs.addEventListener('tabchange', function (e) {
if (e.detail.selectedTabIndex == 2 && playlistNeedsRefresh) {
loadPlaylist(context);
}