From 3171499c4c9a3626127d046debd6275d3bce280f Mon Sep 17 00:00:00 2001 From: Bernhard B Date: Mon, 13 Sep 2021 22:23:34 +0200 Subject: [PATCH] supress enter keypresses in HTML input search fields see #295 --- html/templates/explore.html | 10 +++++++++- .../modules/annotation_browse_select_mode.html | 10 +++++++++- html/templates/modules/label_browse_select_mode.html | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/html/templates/explore.html b/html/templates/explore.html index 3c1e83f1..0c4ae2b1 100644 --- a/html/templates/explore.html +++ b/html/templates/explore.html @@ -244,6 +244,14 @@ $("#query").val(randomElem); }); + $("#query").keyup(function(event) { + if(event.keyCode === 13) { //when enter inside input field is pressed + event.preventDefault(); + $("#goButton").click(); + $("#query").blur(); + } + }); + //in case there are URL parameters prodvided, load when document //gets loaded. {{if ne .queryInfo.Query "" }} @@ -275,7 +283,7 @@

Data should be easily accessible. For Everybody.

-
+

Query the data you are interested in

diff --git a/html/templates/modules/annotation_browse_select_mode.html b/html/templates/modules/annotation_browse_select_mode.html index 133460b6..93537181 100644 --- a/html/templates/modules/annotation_browse_select_mode.html +++ b/html/templates/modules/annotation_browse_select_mode.html @@ -410,6 +410,14 @@ var randomElem = availableLabels[getRandomInt(0, availableLabels.length - 1)]; $("#annotationQuery").val(randomElem); }); + + $("#annotationQuery").keyup(function(event) { + if(event.keyCode === 13) { //when enter inside input field is pressed + event.preventDefault(); + populateImageGrid(); + $("#annotationQuery").blur(); + } + }); }); @@ -417,7 +425,7 @@
- +

Search for annotation tasks you are interested in

diff --git a/html/templates/modules/label_browse_select_mode.html b/html/templates/modules/label_browse_select_mode.html index 0dce1791..d6a9b639 100644 --- a/html/templates/modules/label_browse_select_mode.html +++ b/html/templates/modules/label_browse_select_mode.html @@ -312,7 +312,7 @@
- +

Search for images you are interested in