Skip to content
Snippets Groups Projects
Commit 7d05e6a3 authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

fikser meta#298

parent 032de16c
No related branches found
No related tags found
No related merge requests found
......@@ -69,9 +69,14 @@
});
hits.reverse()
hits = hits.slice(0, 9)
if (q) {
hits.push({q: encodeURIComponent(q), label: q + ' '})
}
}
hits.sort( (h1, h2) => {
let val1 = h1.label.length * 10 + (h1.label[0].toLowerCase() === h1.label[0] ? 0 : 1)
let val2 = h2.label.length * 10 + (h2.label[0].toLowerCase() === h2.label[0] ? 0 : 1)
return val1 - val2
})
if (q) {
hits.push({q: encodeURIComponent(q), label: q + ' '})
}
self.items = hits
self.loading = false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment