diff options
Diffstat (limited to 'searx/static/themes/oscar/js/searx.js')
-rw-r--r-- | searx/static/themes/oscar/js/searx.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/searx/static/themes/oscar/js/searx.js b/searx/static/themes/oscar/js/searx.js index c6feda50c..c93f597fe 100644 --- a/searx/static/themes/oscar/js/searx.js +++ b/searx/static/themes/oscar/js/searx.js @@ -78,7 +78,13 @@ if(searx.autocompleter) { } $(document).ready(function(){ + var original_search_value = ''; if(searx.autocompleter) { + $("#q").on('keydown', function(e) { + if(e.which == 13) { + original_search_value = $('#q').val(); + } + }); $('#q').typeahead(null, { name: 'search-results', displayKey: function(result) { @@ -87,6 +93,9 @@ $(document).ready(function(){ source: searx.searchResults.ttAdapter() }); $('#q').bind('typeahead:selected', function(ev, suggestion) { + if(original_search_value) { + $('#q').val(original_search_value); + } $("#search_form").submit(); }); } |