From a4cac1fcab7d033fdd3a35174c825e925c3eb4a7 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 10 Jul 2018 13:34:38 +0200 Subject: UI: improve layout and action for search --- ishtar_common/templates/widgets/search_input.html | 39 ++++++++++++++++------- 1 file changed, 27 insertions(+), 12 deletions(-) (limited to 'ishtar_common/templates/widgets/search_input.html') diff --git a/ishtar_common/templates/widgets/search_input.html b/ishtar_common/templates/widgets/search_input.html index ddb62969f..01e49e93b 100644 --- a/ishtar_common/templates/widgets/search_input.html +++ b/ishtar_common/templates/widgets/search_input.html @@ -1,28 +1,38 @@ {% load i18n %}
- - - - - - - + + + + + - + - - + + +
@@ -30,10 +40,15 @@ $(document).ready(function(){ $(".search-widget input").keypress(function(e) { - if (e.which == 13) { + var key = e.key; + if (key === "Enter") { $(".search_button").click(); $(this).focus(); } + if (key === "Escape") { + $("#clear-search-button").click(); + $(this).focus(); + } }); $(".search-widget input").keyup(function(e) { enable_save(); -- cgit v1.2.3