mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
use just note title in note autocomplete input field
This commit is contained in:
parent
a37fa0cb3f
commit
42ecc0e15b
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "trilium",
|
||||
"version": "0.43.3",
|
||||
"version": "0.43.4",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -77,7 +77,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"cross-env": "7.0.2",
|
||||
"electron": "9.2.1",
|
||||
"electron": "9.3.0",
|
||||
"electron-builder": "22.8.0",
|
||||
"electron-packager": "15.1.0",
|
||||
"electron-rebuild": "2.0.1",
|
||||
|
@ -95,7 +95,12 @@ function initNoteAutocomplete($el, options) {
|
||||
}
|
||||
]);
|
||||
|
||||
$el.on('autocomplete:selected', (event, suggestion) => $el.setSelectedNotePath(suggestion.notePath));
|
||||
$el.on('autocomplete:selected', (event, suggestion) => {
|
||||
$el.setSelectedNotePath(suggestion.notePath);
|
||||
|
||||
$el.autocomplete("val", suggestion.noteTitle);
|
||||
});
|
||||
|
||||
$el.on('autocomplete:closed', () => {
|
||||
if (!$el.val().trim()) {
|
||||
clearText($el);
|
||||
|
@ -57,12 +57,16 @@ function getRecentNotes(activeNoteId) {
|
||||
LIMIT 200`, params);
|
||||
|
||||
return recentNotes.map(rn => {
|
||||
const title = noteCacheService.getNoteTitleForPath(rn.notePath.split('/'));
|
||||
const notePathArray = rn.notePath.split('/');
|
||||
|
||||
const noteTitle = noteCacheService.getNoteTitle(notePathArray[notePathArray.length - 1]);
|
||||
const notePathTitle = noteCacheService.getNoteTitleForPath(notePathArray);
|
||||
|
||||
return {
|
||||
notePath: rn.notePath,
|
||||
notePathTitle: title,
|
||||
highlightedNotePathTitle: utils.escapeHtml(title)
|
||||
noteTitle,
|
||||
notePathTitle,
|
||||
highlightedNotePathTitle: utils.escapeHtml(notePathTitle)
|
||||
};
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user