mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
playlistedit.js
This commit is contained in:
parent
44ba92261d
commit
f5e62cbd65
1 changed files with 28 additions and 17 deletions
|
@ -8,32 +8,43 @@ define(["listView"], function(listView) {
|
|||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb",
|
||||
UserId: ApiClient.getCurrentUserId()
|
||||
};
|
||||
return ApiClient.getJSON(ApiClient.getUrl("Playlists/" + itemId + "/Items", query))
|
||||
}
|
||||
return ApiClient.getJSON(ApiClient.getUrl("Playlists/" + itemId + "/Items", query));
|
||||
};
|
||||
}
|
||||
|
||||
function getItemsHtmlFn(itemId) {
|
||||
return function (items) {
|
||||
return listView.getListViewHtml({
|
||||
items: items,
|
||||
showIndex: !1,
|
||||
showRemoveFromPlaylist: !0,
|
||||
playFromHere: !0,
|
||||
showIndex: false,
|
||||
showRemoveFromPlaylist: true,
|
||||
playFromHere: true,
|
||||
action: "playallfromhere",
|
||||
smallIcon: !0,
|
||||
dragHandle: !0,
|
||||
smallIcon: true,
|
||||
dragHandle: true,
|
||||
playlistId: itemId
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function init(page, item) {
|
||||
var elem = page.querySelector("#childrenContent .itemsContainer");
|
||||
elem.classList.add("vertical-list"), elem.classList.remove("vertical-wrap"), elem.enableDragReordering(!0), elem.fetchData = getFetchPlaylistItemsFn(item.Id), elem.getItemsHtml = getItemsHtmlFn(item.Id)
|
||||
elem.classList.add("vertical-list");
|
||||
elem.classList.remove("vertical-wrap");
|
||||
elem.enableDragReordering(true);
|
||||
elem.fetchData = getFetchPlaylistItemsFn(item.Id);
|
||||
elem.getItemsHtml = getItemsHtmlFn(item.Id);
|
||||
}
|
||||
|
||||
window.PlaylistViewer = {
|
||||
render: function (page, item) {
|
||||
page.playlistInit || (page.playlistInit = !0, init(page, item)), page.querySelector("#childrenContent").classList.add("verticalSection-extrabottompadding"), page.querySelector("#childrenContent .itemsContainer").refreshItems()
|
||||
if (!page.playlistInit) {
|
||||
page.playlistInit = true;
|
||||
init(page, item);
|
||||
}
|
||||
|
||||
page.querySelector("#childrenContent").classList.add("verticalSection-extrabottompadding");
|
||||
page.querySelector("#childrenContent .itemsContainer").refreshItems();
|
||||
}
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue