From 1328d77cdc0b4fb340def1db988274e3e60007d5 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Mon, 23 Oct 2023 13:27:38 +0200 Subject: [PATCH] changed: use prompt for grep --- main.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/main.js b/main.js index d6eb382..2269f71 100644 --- a/main.js +++ b/main.js @@ -1650,19 +1650,10 @@ function showgrepresult(grepresult) function showgrep() { - filteredlist.hidden = true; - searchdialog.hidden = false; - filter.focus(); - filter.select(); - - filter.onkeydown = function() + var text = prompt("Search:"); + if (text) { - if (event.key === "Enter") - { - event.preventDefault(); - searchdialog.hidden = true; - showgrepresult(grep(filter.value)); - } + showgrepresult(grep(text)); } }