Browse Source

WebUI: Improve hotkeys

PR #18326.
Fixes #18325.
Fixes #14033.
adaptive-webui-19844
Fidel Selva 2 years ago committed by GitHub
parent
commit
61dbb211c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      src/webui/www/private/scripts/client.js

12
src/webui/www/private/scripts/client.js

@ -1350,14 +1350,26 @@ new Keyboard({ @@ -1350,14 +1350,26 @@ new Keyboard({
defaultEventType: 'keydown',
events: {
'ctrl+a': function(event) {
if (event.target.nodeName == "INPUT" || event.target.nodeName == "TEXTAREA")
return;
if (event.target.isContentEditable)
return;
torrentsTable.selectAll();
event.preventDefault();
},
'delete': function(event) {
if (event.target.nodeName == "INPUT" || event.target.nodeName == "TEXTAREA")
return;
if (event.target.isContentEditable)
return;
deleteFN();
event.preventDefault();
},
'shift+delete': (event) => {
if (event.target.nodeName == "INPUT" || event.target.nodeName == "TEXTAREA")
return;
if (event.target.isContentEditable)
return;
deleteFN(true);
event.preventDefault();
}

Loading…
Cancel
Save