From 2729bb35bad2d2d5fffcb5e7b213d63188d05ce4 Mon Sep 17 00:00:00 2001 From: Kai Labusch Date: Mon, 27 Jan 2020 12:53:11 +0100 Subject: [PATCH] #44; disable all the key combinations while editing --- neath.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/neath.js b/neath.js index 4c749c1..9e6981f 100644 --- a/neath.js +++ b/neath.js @@ -450,6 +450,8 @@ function setupInterface(data, file, urls) { keys: 's t', on_keydown: function() { + if (editingTd != null) return true; + tableEditAction(row.data('tableInfo').nRow, 'sentence'); }, is_sequence: true, @@ -461,6 +463,8 @@ function setupInterface(data, file, urls) { keys: 's p', on_keydown: function() { + if (editingTd != null) return true; + tableEditAction(row.data('tableInfo').nRow, 'split'); }, is_sequence: true, @@ -472,6 +476,8 @@ function setupInterface(data, file, urls) { keys: 'm e', on_keydown: function() { + if (editingTd != null) return true; + tableEditAction(row.data('tableInfo').nRow, 'merge'); }, is_sequence: true, @@ -483,6 +489,8 @@ function setupInterface(data, file, urls) { keys: 'd l', on_keydown: function() { + if (editingTd != null) return true; + tableEditAction(row.data('tableInfo').nRow, 'delete'); }, is_sequence: true, @@ -821,7 +829,7 @@ function setupInterface(data, file, urls) { $('#tableregion')[0].addEventListener("wheel", function(event) { - if (editingTd != null) return; + if (editingTd != null) return true; if (event.deltaY < 0) stepsBackward(1); else stepsForward(1); @@ -836,14 +844,14 @@ function setupInterface(data, file, urls) { wnd_listener.simple_combo('pageup', function() { - if (editingTd != null) return; + if (editingTd != null) return true; $('#back').click(); }); wnd_listener.simple_combo('pagedown', function() { - if (editingTd != null) return; + if (editingTd != null) return true; $('#next').click(); }); @@ -949,6 +957,8 @@ function setupInterface(data, file, urls) { wnd_listener.sequence_combo('l a', function() { + if (editingTd != null) return true; + displayRows++; endIndex = startIndex + displayRows; @@ -967,6 +977,8 @@ function setupInterface(data, file, urls) { wnd_listener.sequence_combo('l r', function() { + if (editingTd != null) return true; + if (displayRows > 5) displayRows--; endIndex = startIndex + displayRows;