1
0
Fork 0
mirror of https://github.com/qurator-spk/neat.git synced 2025-06-11 20:59:54 +02:00

Add Ctrl+Down/Up

move entire table one row Up/Down
This commit is contained in:
Kai Labusch 2019-12-13 13:57:48 +01:00
parent 655a1f232e
commit 4ae032ea87
2 changed files with 64 additions and 23 deletions

View file

@ -92,6 +92,8 @@ We also provide some [Python tools](https://github.com/qurator-spk/neath/tree/ma
| Down | Move one row down |
| PageDown | Move page down |
| PageUp | Move page up |
| Crtl+Up | Move entire table one row up |
| Crtl+Down| Move entire table one row down |
|----------|--------------------------------------------|
| s t | Start new sentence in current row |
| m e | Merge current row with row above |

View file

@ -854,37 +854,76 @@ function setupInterface(data, file, urls) {
}
});
wnd_listener.simple_combo('up',
function() {
if (editingTd != null) return true;
wnd_listener.register_combo(
{
keys: 'meta up',
on_keydown:
function() {
if (editingTd != null) return true;
let prev = $(':focus').closest('tr').prev('tr')
stepsBackward(1);
},
is_solitary: true
}
);
let pos = $(':focus').closest('tr').children('.editable').index($(':focus'))
wnd_listener.register_combo(
{
keys: 'up',
if (prev.length==0) {
stepsBackward(1);
}
else {
prev.children('.editable')[pos].focus();
}
on_keydown:
function() {
if (editingTd != null) return true;
let prev = $(':focus').closest('tr').prev('tr')
let pos = $(':focus').closest('tr').children('.editable').index($(':focus'))
if (prev.length==0) {
stepsBackward(1);
}
else {
prev.children('.editable')[pos].focus();
}
},
is_solitary : true
});
wnd_listener.simple_combo('down',
function() {
if (editingTd != null) return true;
wnd_listener.register_combo(
{
keys: 'meta down',
let next = $(':focus').closest('tr').next('tr')
on_keydown: function() {
if (editingTd != null) return true;
let pos = $(':focus').closest('tr').children('.editable').index($(':focus'))
if (next.length==0) {
stepsForward(1);
}
else {
next.children('.editable')[pos].focus();
}
});
},
is_solitary: true
}
);
wnd_listener.register_combo(
{
keys : 'down',
on_keydown:
function() {
if (editingTd != null) return true;
let next = $(':focus').closest('tr').next('tr')
let pos = $(':focus').closest('tr').children('.editable').index($(':focus'))
if (next.length==0) {
stepsForward(1);
}
else {
next.children('.editable')[pos].focus();
}
},
is_solitary: true,
}
);
wnd_listener.sequence_combo('l a',
function() {