From 1b72a1e72dc2fca6b1c4395b32035b490ea17af3 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 1 Oct 2023 17:18:07 -0400 Subject: [PATCH] Allow macOS users to use Ctrl + Cmd + Space to bring up the emoji picker in Friendica text fields - Remove Backspace guard against changing page - Clarify keyboard shortcut to pause automatic updates --- view/js/main.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/view/js/main.js b/view/js/main.js index 6a7874a1e2..c55f85d917 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -378,16 +378,10 @@ $(function() { // Allow folks to stop the ajax page updates with the pause/break key $(document).keydown(function(event) { - if (event.keyCode == '8') { - var target = event.target || event.srcElement; - if (!/input|textarea/i.test(target.nodeName)) { - return false; - } - } - - if (event.keyCode == '19' || (event.ctrlKey && event.which == '32')) { + // Pause/Break or Ctrl + Space + if (event.which === 19 || (!event.shiftKey && !event.altKey && event.ctrlKey && event.which === 32)) { event.preventDefault(); - if (stopped == false) { + if (stopped === false) { stopped = true; if (event.ctrlKey) { totStopped = true;