From: fpunktk Date: Thu, 28 May 2015 18:17:24 +0000 (+0200) Subject: only focus the input if it is empty X-Git-Url: https://fpunktk.de/gitweb/?p=consearch.git;a=commitdiff_plain;h=7141ba5172b3f6438e481a174ea7d133700aee6e only focus the input if it is empty --- diff --git a/index.php b/index.php index e20e4a9..1f3311e 100644 --- a/index.php +++ b/index.php @@ -119,13 +119,13 @@ function display_searchbuttons() { for ( kw in se ) { document.getElementById("searchbuttons").innerHTML += ' \n"; } - document.getElementById("querystring").focus(); } function parse_fragmentstring() { var fragmentstring = document.URL.substr( document.URL.split("#")[0].length + 1 ); if ( fragmentstring == "" ) { display_searchbuttons(); + document.getElementById("querystring").focus(); } else { fragmentarr = fragmentstring.replace("%20", "+").split("+"); if ( se[fragmentarr[0]] ) {