add keyboard shortcut to delete item from context browser

This commit is contained in:
Rolux 2016-01-07 10:43:42 +05:30
parent 4019a987a6
commit 4e056e4ecf
2 changed files with 11 additions and 2 deletions

View file

@ -76,6 +76,12 @@ oml.ui.browser = function() {
'overflow-y': 'hidden'
})
.bindEvent({
key_control_delete: function() {
var listData = oml.getListData();
if (listData.own) {
oml.ui.deleteItemsDialog().open();
}
},
open: function(data) {
if (that.value(data.ids[0], 'mediastate') == 'available') {
oml.UI.set({itemView: 'book'});

View file

@ -19,14 +19,17 @@ oml.ui.deleteItemsDialog = function() {
title: Ox._('Yes, Delete {0}', [itemsName])
})
],
content: Ox._('Are you sure that you want to permanently delete {0}?', [theseItemsName]),
content: Ox._(
'Are you sure that you want to permanently delete {0}?',
[theseItemsName]
),
title: Ox._('Delete {0}', [itemsName])
}, function() {
oml.api.remove({
ids: items
}, function() {
oml.UI.set({listSelection: []});
Ox.Request.clearCache(); // to much?
Ox.Request.clearCache(); // too much?
oml.$ui.list.updateElement();
oml.user.ui.item && oml.UI.set({
item: '',