From 90e74fbb288b2f1df0516d877d3bd239c7800412 Mon Sep 17 00:00:00 2001
From: Noemi Vanyi <sitbackandwait@gmail.com>
Date: Mon, 25 Jul 2016 23:40:31 +0200
Subject: [PATCH] search on filter select

---
 searx/static/plugins/js/search_on_category_select.js | 5 +++++
 searx/templates/oscar/time-range.html                | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/searx/static/plugins/js/search_on_category_select.js b/searx/static/plugins/js/search_on_category_select.js
index a6dd447a0..19aeef944 100644
--- a/searx/static/plugins/js/search_on_category_select.js
+++ b/searx/static/plugins/js/search_on_category_select.js
@@ -10,5 +10,10 @@ $(document).ready(function() {
             }
             return false;
         });
+        $('#time-range > option').click(function(e) {
+            if($('#q').val()) {
+                $('#search_form').submit();
+            }
+        });
     }
 });
diff --git a/searx/templates/oscar/time-range.html b/searx/templates/oscar/time-range.html
index fc1d10dd9..4a13c4fdb 100644
--- a/searx/templates/oscar/time-range.html
+++ b/searx/templates/oscar/time-range.html
@@ -1,4 +1,4 @@
-<select name="time_range">
+<select name="time_range" id="time-range">
     <option id="time-range-anytime" value="" {{ "selected" if time_range=="" or not time_range  else ""}}>
         {{ _('Anytime') }}
     </option>