From 48606867454b93c7d11708b8193fbc2a4368aaf9 Mon Sep 17 00:00:00 2001 From: Klap-in Date: Sun, 3 Feb 2013 19:53:11 +0100 Subject: use var and remove suggestions when needed Use variable for maximum number of suggestions for quicksearch. And hide suggestions when search field is emptied, or when no suggestion are found. --- lib/exe/ajax.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/exe/ajax.php') diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php index fdc28d4f1..9769503a7 100644 --- a/lib/exe/ajax.php +++ b/lib/exe/ajax.php @@ -45,6 +45,8 @@ function ajax_qsearch(){ global $lang; global $INPUT; + $maxnumbersuggestions = 50; + $query = $INPUT->post->str('q'); if(empty($query)) $query = $INPUT->get->str('q'); if(empty($query)) return; @@ -72,7 +74,7 @@ function ajax_qsearch(){ echo '
  • ' . html_wikilink(':'.$id,$name) . '
  • '; $counter ++; - if($counter > 50) { + if($counter > $maxnumbersuggestions) { echo '
  • ...
  • '; break; } -- cgit v1.2.3