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:
parent
7e34533cae
commit
e674b68b00
4 changed files with 52 additions and 5 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue