Add link to search header for storing search

This commit is contained in:
John R. Supplee 2021-01-17 21:04:05 +02:00
parent 409b8559d7
commit 7e8475e64d
4 changed files with 13 additions and 4 deletions

View file

@ -27,6 +27,7 @@ template(name="globalSearch")
else
h1
= resultsHeading.get
a.fa.fa-link(title="{{_ 'link-to-search' }}" href="{{ getSearchHref }}")
each card in results
+resultCard(card)
else

View file

@ -41,6 +41,7 @@ BlazeComponent.extendComponent({
this.hasQueryErrors = new ReactiveVar(false);
this.query = new ReactiveVar('');
this.resultsHeading = new ReactiveVar('');
this.searchLink = new ReactiveVar(null);
this.queryParams = null;
this.parsingErrors = [];
this.resultsCount = 0;
@ -258,6 +259,11 @@ BlazeComponent.extendComponent({
});
},
getSearchHref() {
const baseUrl = window.location.href.replace(/([?#].*$|\s*$)/, '');
return `${baseUrl}?q=${encodeURIComponent(this.query.get())}`;
},
searchInstructions() {
tags = {
operator_board: TAPi18n.__('operator-board'),