autocomplete for add link dialog, #203

This commit is contained in:
azivner
2018-11-07 17:16:33 +01:00
parent a0f362457e
commit 90dbe637ed
6 changed files with 39 additions and 56 deletions

View File

@@ -44,11 +44,17 @@ function initNoteAutocomplete($el) {
displayKey: 'title',
templates: {
suggestion: function(suggestion) {
return suggestion.title;
return suggestion.highlighted;
}
}
}
]);
$el.on('autocomplete:selected', function(event, suggestion, dataset) {
$el.prop("data-selected-path", suggestion.path);
});
$el.getSelectedPath = () => $el.prop("data-selected-path");
}
return $el;