mirror of
https://github.com/danbulant/api_docs
synced 2026-05-21 05:08:48 +00:00
Fixes a variable leak and simplifies low score filtration
Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
This commit is contained in:
parent
e5cf1f2589
commit
e0cee862d9
1 changed files with 3 additions and 8 deletions
|
|
@ -71,18 +71,13 @@
|
|||
if (this.value) {
|
||||
sections.hide();
|
||||
// results are sorted by score in descending order
|
||||
var tmpResults = index.search(this.value);
|
||||
var results = [];
|
||||
|
||||
// remove low score matches
|
||||
$.each(tmpResults, function (index, item) {
|
||||
if (item.score >= 0.0001) results.push(item);
|
||||
});
|
||||
var results = index.search(this.value);
|
||||
|
||||
if (results.length) {
|
||||
lastRef = null;
|
||||
resetHeaderLocations();
|
||||
var lastRef;
|
||||
$.each(results, function (index, item) {
|
||||
if (item.score <= 0.0001) return; // remove low-score results
|
||||
var itemRef = item.ref;
|
||||
$('#section-' + itemRef).show();
|
||||
// headers must be repositioned in the DOM
|
||||
|
|
|
|||
Loading…
Reference in a new issue