Commit 078c42a0 authored by Robert Lord's avatar Robert Lord

Merge pull request #63 from chrissrogers/dev

Fixes a variable leak and simplifies low score filtration
parents e5cf1f25 e0cee862
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment