improved handling of delete when in item view
This commit is contained in:
parent
5882e97608
commit
09687f0cd7
1 changed files with 18 additions and 7 deletions
|
@ -80,8 +80,9 @@ oml.ui.browser = function() {
|
|||
})
|
||||
.bindEvent({
|
||||
key_control_delete: function() {
|
||||
var listData = oml.getListData();
|
||||
if (listData.own) {
|
||||
if (that.value(
|
||||
that.options('selected')[0], 'mediastate'
|
||||
) == 'available') {
|
||||
oml.ui.deleteItemsDialog().open();
|
||||
}
|
||||
},
|
||||
|
@ -100,6 +101,14 @@ oml.ui.browser = function() {
|
|||
});
|
||||
} else {
|
||||
// no longer in context after edit
|
||||
oml.api.find({
|
||||
query: {conditions: [], operator: '&'},
|
||||
positions: [ui.item]
|
||||
}, function(result) {
|
||||
if (result.data.positions[ui.item] === void 0) {
|
||||
// no longer in libraries after delete
|
||||
oml.UI.set({item: ''});
|
||||
} else {
|
||||
oml.stayInItemView = true;
|
||||
oml.UI.set({
|
||||
find: {conditions: [], operator: '&'},
|
||||
|
@ -107,6 +116,8 @@ oml.ui.browser = function() {
|
|||
});
|
||||
oml.stayInItemView = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
toggle: function(data) {
|
||||
|
|
Loading…
Reference in a new issue