add keyboard shortcut to delete item from context browser
This commit is contained in:
parent
4019a987a6
commit
4e056e4ecf
2 changed files with 11 additions and 2 deletions
|
@ -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'});
|
||||
|
|
|
@ -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: '',
|
||||
|
|
Loading…
Reference in a new issue