stay in item view when edit makes item disappear from context

This commit is contained in:
rlx 2016-01-14 15:31:38 +05:30
parent 2ad1e64208
commit e8eefd95bf

View file

@ -92,11 +92,21 @@ oml.ui.browser = function() {
}, },
select: function(data) { select: function(data) {
if (ui.item) { if (ui.item) {
oml.UI.set({ if (data.ids.length) {
item: data.ids[0], oml.UI.set({
itemView: 'info', item: data.ids[0],
listSelection: data.ids itemView: 'info',
}); listSelection: data.ids
});
} else {
// no longer in context after edit
oml.stayInItemView = true;
oml.UI.set({
find: {conditions: [], operator: '&'},
listSelection: [ui.item]
});
oml.stayInItemView = false;
}
} }
}, },
toggle: function(data) { toggle: function(data) {