finished jump to autocomplete, now with token highlighting, #203

This commit is contained in:
azivner
2018-11-07 09:35:29 +01:00
parent 3c23d7085e
commit 1febf5136c
6 changed files with 46 additions and 52 deletions

View File

@@ -6,20 +6,14 @@ async function autocompleteSource(term, cb) {
+ '?query=' + encodeURIComponent(term)
+ '&currentNoteId=' + noteDetailService.getCurrentNoteId());
if (result.length > 0) {
cb(result.map(row => {
return {
label: row.label,
value: row.label + ' (' + row.value + ')'
}
}));
}
else {
cb([{
label: "No results",
value: "No results"
}]);
if (result.length === 0) {
result.push({
title: "No results",
path: ""
});
}
cb(result);
}
async function initNoteAutocomplete($el) {