Browse Source

Added back Global Search related code that caused Snap to not build.

Thanks to xet7 !

Related https://github.com/wekan/wekan/pull/3492
Lauri Ojansivu 4 years ago
parent
commit
334dfa5cb6

+ 1 - 1
client/components/main/globalSearch.jade

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

+ 5 - 0
client/components/main/globalSearch.js

@@ -480,6 +480,11 @@ BlazeComponent.extendComponent({
     });
     });
   },
   },
 
 
+  getSearchHref() {
+    const baseUrl = window.location.href.replace(/([?#].*$|\s*$)/, '');
+    return `${baseUrl}?q=${encodeURIComponent(this.query.get())}`;
+  },
+
   searchInstructions() {
   searchInstructions() {
     tags = {
     tags = {
       operator_board: TAPi18n.__('operator-board'),
       operator_board: TAPi18n.__('operator-board'),