mirror of
https://github.com/zadam/trilium.git
synced 2024-11-10 17:13:45 +08:00
bring back "create and link note" into more places, fixes #1653
This commit is contained in:
parent
4cbf9c2e86
commit
0c9a11db6f
6 changed files with 15 additions and 6 deletions
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue