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

added delete method for virtual items

This commit is contained in:
Luke Pulverenti 2013-10-18 17:12:05 -04:00
parent 7e34533cae
commit e674b68b00
4 changed files with 52 additions and 5 deletions

View file

@ -350,17 +350,24 @@
}
$('#btnRefresh', page).button('enable');
$('#btnDelete', page).button('enable');
$('#refreshLoading', page).hide();
currentItem = item;
if (item.IsFolder) {
$('#fldRecursive', page).css("display", "inline-block")
$('#fldRecursive', page).css("display", "inline-block");
} else {
$('#fldRecursive', page).hide();
}
if (item.LocationType == "Virtual") {
$('#fldDelete', page).show();
} else {
$('#fldDelete', page).hide();
}
LibraryBrowser.renderName(item, $('.itemName', page), true);
updateTabs(page, item);
@ -1143,7 +1150,8 @@
$('#btnRefresh', this).on('click', function () {
$(this).button('disable');
$('#btnDelete', page).button('disable');
$('#btnRefresh', page).button('disable');
$('#refreshLoading', page).show();
@ -1180,6 +1188,28 @@
});
});
$('#btnDelete', this).on('click', function () {
Dashboard.confirm("Are you sure you wish to delete this item?", "Confirm Deletion", function (result) {
if (result) {
$('#btnDelete', page).button('disable');
$('#btnRefresh', page).button('disable');
$('#refreshLoading', page).show();
ApiClient.deleteItem(currentItem.Id).done(function () {
Dashboard.navigate('edititemmetadata.html?id=' + currentItem.ParentId);
});
}
});
});
$('.libraryTree', page).on('itemclicked', function (event, data) {
if (data.id != currentItem.Id) {