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

update listviews

This commit is contained in:
Luke Pulverenti 2016-07-16 21:58:51 -04:00
parent b5734e3e93
commit 722a452b91
19 changed files with 277 additions and 155 deletions

View file

@ -685,15 +685,6 @@
});
},
supportsEditing: function (itemType) {
if (itemType == "UserRootFolder" || /*itemType == "CollectionFolder" ||*/ itemType == "UserView" || itemType == 'Timer') {
return false;
}
return true;
},
getMoreCommands: function (item, user) {
var commands = [];
@ -715,7 +706,7 @@
if (user.Policy.IsAdministrator) {
if (LibraryBrowser.supportsEditing(item.Type)) {
if (itemHelper.canEdit(user, item.Type)) {
commands.push('edit');
}
@ -733,7 +724,7 @@
commands.push('refresh');
}
if (LibraryBrowser.enableSync(item, user)) {
if (itemHelper.canSync(user, item)) {
commands.push('sync');
}
@ -747,34 +738,13 @@
commands.push('share');
}
if (LibraryBrowser.canIdentify(user, item.Type)) {
if (itemHelper.canIdentify(user, item.Type)) {
commands.push('identify');
}
return commands;
},
canIdentify: function (user, itemType) {
if (itemType == "Movie" ||
itemType == "Trailer" ||
itemType == "Series" ||
itemType == "Game" ||
itemType == "BoxSet" ||
itemType == "Person" ||
itemType == "Book" ||
itemType == "MusicAlbum" ||
itemType == "MusicArtist") {
if (user.Policy.IsAdministrator) {
return true;
}
}
return false;
},
deleteItems: function (itemIds) {
return new Promise(function (resolve, reject) {
@ -1301,18 +1271,6 @@
return html;
},
enableSync: function (item, user) {
if (AppInfo.isNativeApp && !Dashboard.capabilities().SupportsSync) {
return false;
}
if (user && !user.Policy.EnableSync) {
return false;
}
return item.SupportsSync;
},
getItemCommands: function (item, options) {
var itemCommands = [];
@ -1321,9 +1279,7 @@
// itemCommands.push('playmenu');
//}
if (LibraryBrowser.supportsEditing(item.Type)) {
itemCommands.push('edit');
}
itemCommands.push('edit');
if (item.LocalTrailerCount) {
itemCommands.push('trailer');
@ -1365,7 +1321,7 @@
itemCommands.push('delete');
}
if (LibraryBrowser.enableSync(item)) {
if (itemHelper.canSync({ Policy: {} }, item)) {
itemCommands.push('sync');
}