Browse Source

Merge pull request #14 from dalf/master

focus on search input
Adam Tauber 11 years ago
parent
commit
b1c6b0a3f1
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      searx/static/js/searx.js
  2. 1
    1
      searx/templates/search.html

+ 1
- 1
searx/static/js/searx.js View File

@@ -17,7 +17,7 @@
17 17
 
18 18
     addListener(w, 'load', function () {
19 19
         var qinput = d.getElementById('q');
20
-        if (qinput !== null) {
20
+        if (qinput !== null && qinput.value === "") {
21 21
             addListener(qinput, 'focus', placeCursorAtEnd);
22 22
             qinput.focus();
23 23
         }

+ 1
- 1
searx/templates/search.html View File

@@ -1,6 +1,6 @@
1 1
 <form method="post" action="/" id="search_form">
2 2
 <div id="search_wrapper">
3
-    <input type="text" class="q" name="q" tabindex="1" autocomplete="off" {% if q %}value="{{ q }}"{% endif %}/>
3
+    <input type="text" id="q" class="q" name="q" tabindex="1" autocomplete="off" {% if q %}value="{{ q }}"{% endif %}/>
4 4
     <input type="submit" value="" id="search_submit" />
5 5
 </div>
6 6
     <div>