Skip to content
Snippets Groups Projects
Commit edbe89b8 authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

bruk "lang" i url som pushes

parent 073ad077
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
if(event._source){ if(event._source){
this.search_results = [] this.search_results = []
this.article = event._source this.article = event._source
history.pushState(this.article, '', event._id) history.pushState(this.article, '', '/' + this.lang + '/' + event._id)
}else{ }else{
window.location.href = '/' + this.lang + "/search?q=" + event.q window.location.href = '/' + this.lang + "/search?q=" + event.q
} }
...@@ -106,6 +106,11 @@ export default { ...@@ -106,6 +106,11 @@ export default {
else { else {
this.waiting = false this.waiting = false
} }
},
watch: {
$route(to, from) {
this.lang = this.$route.params.lang || 'nob'
}
} }
} }
</script> </script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment