mirror of
https://github.com/sissbruecker/linkding
synced 2024-11-22 11:23:02 +00:00
Make search autocomplete respect link target setting (#513)
This commit is contained in:
parent
f9496e2fe0
commit
768f1346a3
3 changed files with 4 additions and 1 deletions
|
@ -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') {
|
||||||
|
|
|
@ -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,
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue