commonsearch / cosr-front

Frontend of Common Search. Go server for fetching and rendering results + HTML5 UI to browse them.
https://uidemo.commonsearch.org
Apache License 2.0
61 stars 13 forks source link

Keep language in logo link #7

Closed sylvinus closed 8 years ago

sylvinus commented 8 years ago

Because we don't use cookies, language detection is a bit fragile.

Currently clicking on the logo loses the selected language, it would be great to keep the ?g=fr parameter in the link.

This needs to be done both in JS and in the Go template.

chaconnewu commented 8 years ago

I attempted this issue with this PR: https://github.com/commonsearch/cosr-front/pull/32

The idea is to return to the "full" layout, clear all search related states and timeouts, and use window.history.pushState to append the language info. Please take a look.