mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Show favorite icon in playlist items on desktop layout
This commit is contained in:
parent
4fe179214c
commit
8d31d507c2
1 changed files with 11 additions and 8 deletions
|
@ -465,11 +465,21 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
||||||
function loadPlaylist(context, player) {
|
function loadPlaylist(context, player) {
|
||||||
getPlaylistItems(player).then(function (items) {
|
getPlaylistItems(player).then(function (items) {
|
||||||
var html = '';
|
var html = '';
|
||||||
|
let favoritesEnabled = true;
|
||||||
|
if (layoutManager.mobile) {
|
||||||
|
if (items.length > 0) {
|
||||||
|
context.querySelector('.btnTogglePlaylist').classList.remove('hide');
|
||||||
|
} else {
|
||||||
|
context.querySelector('.btnTogglePlaylist').classList.add('hide');
|
||||||
|
}
|
||||||
|
favoritesEnabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
html += listView.getListViewHtml({
|
html += listView.getListViewHtml({
|
||||||
items: items,
|
items: items,
|
||||||
smallIcon: true,
|
smallIcon: true,
|
||||||
action: 'setplaylistindex',
|
action: 'setplaylistindex',
|
||||||
enableUserDataButtons: false,
|
enableUserDataButtons: favoritesEnabled,
|
||||||
rightButtons: [{
|
rightButtons: [{
|
||||||
icon: 'remove_circle_outline',
|
icon: 'remove_circle_outline',
|
||||||
title: globalize.translate('ButtonRemove'),
|
title: globalize.translate('ButtonRemove'),
|
||||||
|
@ -477,13 +487,6 @@ define(['browser', 'datetime', 'backdrop', 'libraryBrowser', 'listView', 'imageL
|
||||||
}],
|
}],
|
||||||
dragHandle: true
|
dragHandle: true
|
||||||
});
|
});
|
||||||
if (layoutManager.mobile) {
|
|
||||||
if (items.length > 0) {
|
|
||||||
context.querySelector('.btnTogglePlaylist').classList.remove('hide');
|
|
||||||
} else {
|
|
||||||
context.querySelector('.btnTogglePlaylist').classList.add('hide');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var itemsContainer = context.querySelector('.playlist');
|
var itemsContainer = context.querySelector('.playlist');
|
||||||
itemsContainer.innerHTML = html;
|
itemsContainer.innerHTML = html;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue