Make search autocomplete respect link target setting (#513)

This commit is contained in:
Sascha Ißbrücker 2023-08-24 10:22:05 +02:00 committed by GitHub
parent f9496e2fe0
commit 768f1346a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View file

@ -11,6 +11,7 @@
export let mode = ''; export let mode = '';
export let apiClient; export let apiClient;
export let filters; export let filters;
export let linkTarget = '_blank';
let isFocus = false; let isFocus = false;
let isOpen = false; let isOpen = false;
@ -164,7 +165,7 @@
close() close()
} }
if (suggestion.type === 'bookmark') { if (suggestion.type === 'bookmark') {
window.open(suggestion.bookmark.url, '_blank') window.open(suggestion.bookmark.url, linkTarget)
close() close()
} }
if (suggestion.type === 'tag') { if (suggestion.type === 'tag') {

View file

@ -34,6 +34,7 @@
value: '{{ filters.query }}', value: '{{ filters.query }}',
tags: uniqueTags, tags: uniqueTags,
mode: '{{ mode }}', mode: '{{ mode }}',
linkTarget: '{{ request.user_profile.bookmark_link_target }}',
apiClient, apiClient,
filters, filters,
} }

View file

@ -23,6 +23,7 @@ def bookmark_search(context, filters: BookmarkFilters, tags: [Tag], mode: str =
tag_names = [tag.name for tag in tags] tag_names = [tag.name for tag in tags]
tags_string = build_tag_string(tag_names, ' ') tags_string = build_tag_string(tag_names, ' ')
return { return {
'request': context['request'],
'filters': filters, 'filters': filters,
'tags_string': tags_string, 'tags_string': tags_string,
'mode': mode, 'mode': mode,