1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2025-01-06 21:49:40 +02:00

cheat-sheet: don't show nfc icons on empty search

This commit is contained in:
rszyma 2023-05-30 16:32:10 +02:00 committed by Fini Jastrow
parent 5d1ccc69ab
commit 270a604d09

View File

@ -124,16 +124,19 @@ document.addEventListener('DOMContentLoaded', function () {
function searchGlyphs() {
let searchTerm = elementGlyphSearch.value;
let prefixSearchEnabled = true
if (searchTerm === "") {
// MiniSearch don't allow empty searches, so we search for "nf".
searchTerm = "nf";
prefixSearchEnabled = false;
}
// TODO: search suggestions
remainingSearchResults = miniSearch.search(searchTerm,
{
prefix: true,
prefix: prefixSearchEnabled,
combineWith: "AND",
boost: {id: 0.001},
boostDocument: ((documentId, term, storedFields) => {