mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix relation autocomplete
This commit is contained in:
parent
986eace1be
commit
ededc063df
@ -201,7 +201,7 @@ $dialog.on('focus', '.relation-name', function (e) {
|
|||||||
$(this).autocomplete("search", $(this).val());
|
$(this).autocomplete("search", $(this).val());
|
||||||
});
|
});
|
||||||
|
|
||||||
async function initAutocomplete($el) {
|
async function initNoteAutocomplete($el) {
|
||||||
if (!$el.hasClass("ui-autocomplete-input")) {
|
if (!$el.hasClass("ui-autocomplete-input")) {
|
||||||
await $el.autocomplete({
|
await $el.autocomplete({
|
||||||
source: async function (request, response) {
|
source: async function (request, response) {
|
||||||
@ -232,10 +232,14 @@ async function initAutocomplete($el) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$dialog.on('focus', '.relation-target-note-id', async function () {
|
||||||
|
await initNoteAutocomplete($(this));
|
||||||
|
});
|
||||||
|
|
||||||
$dialog.on('click', '.relations-show-recent-notes', async function () {
|
$dialog.on('click', '.relations-show-recent-notes', async function () {
|
||||||
const $autocomplete = $(this).parent().find('.relation-target-note-id');
|
const $autocomplete = $(this).parent().find('.relation-target-note-id');
|
||||||
|
|
||||||
await initAutocomplete($autocomplete);
|
await initNoteAutocomplete($autocomplete);
|
||||||
|
|
||||||
$autocomplete.autocomplete("search", "");
|
$autocomplete.autocomplete("search", "");
|
||||||
});
|
});
|
||||||
|
@ -4,7 +4,7 @@ const repository = require('./repository');
|
|||||||
const Relation = require('../entities/relation');
|
const Relation = require('../entities/relation');
|
||||||
|
|
||||||
const BUILTIN_RELATIONS = [
|
const BUILTIN_RELATIONS = [
|
||||||
'exampleBuiltIn'
|
'runOnNoteView'
|
||||||
];
|
];
|
||||||
|
|
||||||
async function getNotesWithRelation(name, targetNoteId) {
|
async function getNotesWithRelation(name, targetNoteId) {
|
||||||
|
@ -629,7 +629,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input id="jump-to-note-autocomplete" class="form-control relation-target-note-id"
|
<input class="form-control relation-target-note-id"
|
||||||
placeholder="search for note by its name"
|
placeholder="search for note by its name"
|
||||||
data-bind="value: targetNoteId, valueUpdate: 'blur', event: { blur: $parent.relationChanged }"
|
data-bind="value: targetNoteId, valueUpdate: 'blur', event: { blur: $parent.relationChanged }"
|
||||||
style="width: 300px;">
|
style="width: 300px;">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user