diff options
author | Klap-in <klapinklapin@gmail.com> | 2013-01-29 01:44:45 +0100 |
---|---|---|
committer | Klap-in <klapinklapin@gmail.com> | 2013-01-29 01:44:45 +0100 |
commit | d91a4ef556635b5298c47df2856851f0694b2885 (patch) | |
tree | b8e2d5aecdfdfa1d93e47a6b4419467d2811e2ee /lib/exe | |
parent | e4a50ea7ef39fc26378570f7a62c58e9bbf4bfda (diff) | |
download | rpg-d91a4ef556635b5298c47df2856851f0694b2885.tar.gz rpg-d91a4ef556635b5298c47df2856851f0694b2885.tar.bz2 |
Add a break to ajax_qsearch()
When the search input is still only a few characters, the number of matching pages is big.
Browsers have heavy work to progress this whole return, better cut off so only the part that is directly displayed will be sent.
Diffstat (limited to 'lib/exe')
-rw-r--r-- | lib/exe/ajax.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php index 9989269cf..fdc28d4f1 100644 --- a/lib/exe/ajax.php +++ b/lib/exe/ajax.php @@ -57,6 +57,7 @@ function ajax_qsearch(){ print '<strong>'.$lang['quickhits'].'</strong>'; print '<ul>'; + $counter = 0; foreach($data as $id => $title){ if (useHeading('navigation')) { $name = $title; @@ -69,6 +70,12 @@ function ajax_qsearch(){ } } echo '<li>' . html_wikilink(':'.$id,$name) . '</li>'; + + $counter ++; + if($counter > 50) { + echo '<li>...</li>'; + break; + } } print '</ul>'; } |