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

update context menu

This commit is contained in:
Luke Pulverenti 2016-07-16 18:26:21 -04:00
parent 013178a816
commit 289b252066
5 changed files with 52 additions and 10 deletions

View file

@ -1,4 +1,4 @@
define(['apphost', 'globalize', 'connectionManager', 'itemHelper'], function (appHost, globalize, connectionManager, itemHelper) {
define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter'], function (appHost, globalize, connectionManager, itemHelper, embyRouter) {
function getCommands(options) {
@ -48,6 +48,13 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper'], function (ap
});
}
if (options.open !== false) {
commands.push({
name: globalize.translate('Open'),
id: 'open'
});
}
if (user.Policy.IsAdministrator) {
commands.push({
@ -63,6 +70,20 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper'], function (ap
});
}
if (options.openAlbum !== false && item.AlbumId) {
commands.push({
name: Globalize.translate('ViewAlbum'),
id: 'album'
});
}
if (options.openArtist !== false && item.ArtistItems && item.ArtistItems.length) {
commands.push({
name: Globalize.translate('ViewArtist'),
id: 'artist'
});
}
return commands;
});
}
@ -135,6 +156,12 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper'], function (ap
reject();
break;
}
case 'open':
{
embyRouter.showItem(item);
reject();
break;
}
case 'delete':
{
deleteItem(apiClient, itemId).then(function () {
@ -153,6 +180,18 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper'], function (ap
});
break;
}
case 'album':
{
embyRouter.showItem(item.AlbumId, item.ServerId);
reject();
break;
}
case 'artist':
{
embyRouter.showItem(item.ArtistItems[0].Id, item.ServerId);
reject();
break;
}
default:
reject();
break;