Skip to content

Build your personal knowledge base with Trilium Notes

bring back "create and link note" into more places, fixes #1653

zadam0c9a11db6fa1
diff --git a/src/public/app/dialogs/add_link.js b/src/public/app/dialogs/add_link.js
index 3e5bc5d1ba..047ef73a9e 100644
--- a/src/public/app/dialogs/add_link.js
+++ b/src/public/app/dialogs/add_link.js
@@ -41,7 +41,10 @@ export async function showDialog(widget, text = '') {
$linkTitle.val(noteTitle);
}
- noteAutocompleteService.initNoteAutocomplete($autoComplete, { allowExternalLinks: true });
+ noteAutocompleteService.initNoteAutocomplete($autoComplete, {
+ allowExternalLinks: true,
+ allowCreatingNotes: true
+ });
$autoComplete.on('autocomplete:noteselected', (event, suggestion, dataset) => {
if (!suggestion.notePath) {
diff --git a/src/public/app/dialogs/include_note.js b/src/public/app/dialogs/include_note.js
index 9f92c3a92a..0bb6de912b 100644
--- a/src/public/app/dialogs/include_note.js
+++ b/src/public/app/dialogs/include_note.js
@@ -17,7 +17,10 @@ export async function showDialog(widget) {
utils.openDialog($dialog);
- noteAutocompleteService.initNoteAutocomplete($autoComplete, { hideGoToSelectedNoteButton: true });
+ noteAutocompleteService.initNoteAutocomplete($autoComplete, {
+ hideGoToSelectedNoteButton: true,
+ allowCreatingNotes: true
+ });
noteAutocompleteService.showRecentNotes($autoComplete);
}
diff --git a/src/public/app/widgets/attribute_widgets/attribute_detail.js b/src/public/app/widgets/attribute_widgets/attribute_detail.js
index 39f3d2414a..b4f79ba6d7 100644
--- a/src/public/app/widgets/attribute_widgets/attribute_detail.js
+++ b/src/public/app/widgets/attribute_widgets/attribute_detail.js
@@ -279,7 +279,7 @@ export default class AttributeDetailWidget extends TabAwareWidget {
this.$rowTargetNote = this.$widget.find('.attr-row-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) => {
if (!suggestion.notePath) {
return false;
diff --git a/src/public/app/widgets/search_options/search_script.js b/src/public/app/widgets/search_options/search_script.js
index 7853583404..72a2e22f99 100644
--- a/src/public/app/widgets/search_options/search_script.js
+++ b/src/public/app/widgets/search_options/search_script.js
@@ -50,7 +50,7 @@ export default class SearchScript extends AbstractSearchOption {
doRender() {
const $option = $(TPL);
const $searchScript = $option.find('.search-script');
- noteAutocompleteService.initNoteAutocomplete($searchScript);
+ noteAutocompleteService.initNoteAutocomplete($searchScript, {allowCreatingNotes: true});
$searchScript.on('autocomplete:closed', async () => {
const searchScriptNoteId = $searchScript.getSelectedNoteId();
diff --git a/src/public/app/widgets/type_property_widgets/promoted_attributes.js b/src/public/app/widgets/type_property_widgets/promoted_attributes.js
index e8d1c39a85..80b54ab026 100644
--- a/src/public/app/widgets/type_property_widgets/promoted_attributes.js
+++ b/src/public/app/widgets/type_property_widgets/promoted_attributes.js
@@ -210,7 +210,7 @@ export default class PromotedAttributesWidget extends TabAwareWidget {
}
// no need to wait for this
- noteAutocompleteService.initNoteAutocomplete($input);
+ noteAutocompleteService.initNoteAutocomplete($input, {allowCreatingNotes: true});
$input.on('autocomplete:noteselected', (event, suggestion, dataset) => {
this.promotedAttributeChanged(event);
diff --git a/src/public/app/widgets/type_widgets/empty.js b/src/public/app/widgets/type_widgets/empty.js
index 0508d99fe8..18a640342f 100644
--- a/src/public/app/widgets/type_widgets/empty.js
+++ b/src/public/app/widgets/type_widgets/empty.js
@@ -22,7 +22,10 @@ export default class EmptyTypeWidget extends TypeWidget {
this.contentSized();
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) {
if (!suggestion.notePath) {
return false;