Skip to content

Commit

Permalink
simplify search page URL construction
Browse files Browse the repository at this point in the history
  • Loading branch information
osma committed Dec 18, 2024
1 parent 8e720a6 commit 17d5e93
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions resource/js/vocab-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,9 @@ const vocabSearch = Vue.createApp({
gotoSearchPage () {
if (!this.searchTerm) return

const currentVocab = window.SKOSMOS.vocab + '/' + window.SKOSMOS.lang + '/'
const vocabHref = window.location.href.substring(0, window.location.href.lastIndexOf(window.SKOSMOS.vocab)) + currentVocab
const searchUrlParams = new URLSearchParams({ clang: window.SKOSMOS.content_lang, q: this.searchTerm })
if (this.selectedLanguage === 'all') searchUrlParams.set('anylang', 'true')
const searchUrl = vocabHref + 'search?' + searchUrlParams.toString()
const searchUrl = window.SKOSMOS.vocab + '/' + window.SKOSMOS.lang + '/search?' + searchUrlParams.toString()
window.location.href = searchUrl
},
changeLang (clang) {
Expand Down

0 comments on commit 17d5e93

Please sign in to comment.