handle new list keyboard shortcuts

This commit is contained in:
rlx 2016-01-17 15:43:36 +05:30
parent c6613c30f6
commit 8fde5e9111
2 changed files with 22 additions and 2 deletions

View file

@ -217,8 +217,17 @@ oml.ui.folders = function() {
sortable: !index sortable: !index
}) })
.bindEvent({ .bindEvent({
add: function() { add: function(data) {
!index && oml.addList(); var keys = data.keys || '',
listData = oml.getListData();
if (listData.user === '' && (
keys != 'shift' || ui.listSelection
)) {
oml.addList(
Ox.contains(keys, 'alt'),
Ox.contains(keys, 'shift')
);
}
}, },
'delete': function() { 'delete': function() {
!index && oml.ui.deleteListDialog().open(); !index && oml.ui.deleteListDialog().open();

View file

@ -6,6 +6,17 @@ oml.ui.list = function() {
that = oml.ui[ui.listView + 'View']() that = oml.ui[ui.listView + 'View']()
.bindEvent({ .bindEvent({
add: function(data) {
var keys = data.keys || '';
if (!index && (
keys != 'shift' || ui.listSelection
)) {
oml.addList(
Ox.contains(keys, 'alt'),
Ox.contains(keys, 'shift')
);
}
},
closepreview: function() { closepreview: function() {
oml.$ui.previewButton.options({value: false}); oml.$ui.previewButton.options({value: false});
oml.$ui.previewDialog.close(); oml.$ui.previewDialog.close();