mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
bring back "create and link note" into more places, fixes #1653
This commit is contained in:
parent
4cbf9c2e86
commit
0c9a11db6f
@ -41,7 +41,10 @@ export async function showDialog(widget, text = '') {
|
|||||||
$linkTitle.val(noteTitle);
|
$linkTitle.val(noteTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
noteAutocompleteService.initNoteAutocomplete($autoComplete, { allowExternalLinks: true });
|
noteAutocompleteService.initNoteAutocomplete($autoComplete, {
|
||||||
|
allowExternalLinks: true,
|
||||||
|
allowCreatingNotes: true
|
||||||
|
});
|
||||||
|
|
||||||
$autoComplete.on('autocomplete:noteselected', (event, suggestion, dataset) => {
|
$autoComplete.on('autocomplete:noteselected', (event, suggestion, dataset) => {
|
||||||
if (!suggestion.notePath) {
|
if (!suggestion.notePath) {
|
||||||
|
@ -17,7 +17,10 @@ export async function showDialog(widget) {
|
|||||||
|
|
||||||
utils.openDialog($dialog);
|
utils.openDialog($dialog);
|
||||||
|
|
||||||
noteAutocompleteService.initNoteAutocomplete($autoComplete, { hideGoToSelectedNoteButton: true });
|
noteAutocompleteService.initNoteAutocomplete($autoComplete, {
|
||||||
|
hideGoToSelectedNoteButton: true,
|
||||||
|
allowCreatingNotes: true
|
||||||
|
});
|
||||||
noteAutocompleteService.showRecentNotes($autoComplete);
|
noteAutocompleteService.showRecentNotes($autoComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ export default class AttributeDetailWidget extends TabAwareWidget {
|
|||||||
this.$rowTargetNote = this.$widget.find('.attr-row-target-note');
|
this.$rowTargetNote = this.$widget.find('.attr-row-target-note');
|
||||||
this.$inputTargetNote = this.$widget.find('.attr-input-target-note');
|
this.$inputTargetNote = this.$widget.find('.attr-input-target-note');
|
||||||
|
|
||||||
noteAutocompleteService.initNoteAutocomplete(this.$inputTargetNote)
|
noteAutocompleteService.initNoteAutocomplete(this.$inputTargetNote, {allowCreatingNotes: true})
|
||||||
.on('autocomplete:noteselected', (event, suggestion, dataset) => {
|
.on('autocomplete:noteselected', (event, suggestion, dataset) => {
|
||||||
if (!suggestion.notePath) {
|
if (!suggestion.notePath) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -50,7 +50,7 @@ export default class SearchScript extends AbstractSearchOption {
|
|||||||
doRender() {
|
doRender() {
|
||||||
const $option = $(TPL);
|
const $option = $(TPL);
|
||||||
const $searchScript = $option.find('.search-script');
|
const $searchScript = $option.find('.search-script');
|
||||||
noteAutocompleteService.initNoteAutocomplete($searchScript);
|
noteAutocompleteService.initNoteAutocomplete($searchScript, {allowCreatingNotes: true});
|
||||||
|
|
||||||
$searchScript.on('autocomplete:closed', async () => {
|
$searchScript.on('autocomplete:closed', async () => {
|
||||||
const searchScriptNoteId = $searchScript.getSelectedNoteId();
|
const searchScriptNoteId = $searchScript.getSelectedNoteId();
|
||||||
|
@ -210,7 +210,7 @@ export default class PromotedAttributesWidget extends TabAwareWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// no need to wait for this
|
// no need to wait for this
|
||||||
noteAutocompleteService.initNoteAutocomplete($input);
|
noteAutocompleteService.initNoteAutocomplete($input, {allowCreatingNotes: true});
|
||||||
|
|
||||||
$input.on('autocomplete:noteselected', (event, suggestion, dataset) => {
|
$input.on('autocomplete:noteselected', (event, suggestion, dataset) => {
|
||||||
this.promotedAttributeChanged(event);
|
this.promotedAttributeChanged(event);
|
||||||
|
@ -22,7 +22,10 @@ export default class EmptyTypeWidget extends TypeWidget {
|
|||||||
this.contentSized();
|
this.contentSized();
|
||||||
this.$autoComplete = this.$widget.find(".note-autocomplete");
|
this.$autoComplete = this.$widget.find(".note-autocomplete");
|
||||||
|
|
||||||
noteAutocompleteService.initNoteAutocomplete(this.$autoComplete, { hideGoToSelectedNoteButton: true })
|
noteAutocompleteService.initNoteAutocomplete(this.$autoComplete, {
|
||||||
|
hideGoToSelectedNoteButton: true,
|
||||||
|
allowCreatingNotes: true
|
||||||
|
})
|
||||||
.on('autocomplete:noteselected', function(event, suggestion, dataset) {
|
.on('autocomplete:noteselected', function(event, suggestion, dataset) {
|
||||||
if (!suggestion.notePath) {
|
if (!suggestion.notePath) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user