refectored: esc key to prepare back button

This commit is contained in:
quenousimporte 2023-07-04 10:22:57 +02:00
parent 1987e2a0a4
commit d84ec16c5d
1 changed files with 25 additions and 20 deletions

11
main.js
View File

@ -2086,10 +2086,8 @@ function executecommand(command)
} }
} }
function mainkeydownhandler() function esc(event)
{ {
if (event.key == "Escape")
{
if (!searchdialog.hidden) if (!searchdialog.hidden)
{ {
event.preventDefault(); event.preventDefault();
@ -2110,6 +2108,13 @@ function mainkeydownhandler()
{ {
togglepreview(); togglepreview();
} }
}
function mainkeydownhandler()
{
if (event.key == "Escape")
{
esc(event);
} }
else if (!searchdialog.hidden && (event.key == "Tab" || event.keyCode == "40" || event.keyCode == "38")) else if (!searchdialog.hidden && (event.key == "Tab" || event.keyCode == "40" || event.keyCode == "38"))
{ {