mysociety / yournextrepresentative

A website for crowd-sourcing structured election candidate data
https://candidates.democracyclub.org.uk/
GNU Affero General Public License v3.0
56 stars 21 forks source link

Language switcher #917

Closed zarino closed 8 years ago

zarino commented 8 years ago

Language switcher for #676.

Closed: closed

Open: open

Feels a bit fiddly. Will revisit tomorrow morning with fresh eyes.

wfdd commented 8 years ago

A few observations:

zarino commented 8 years ago

It should be possible to POST on click/select with XHR, serving the original dropdown to clients that support JavaScript. Having to press 'Go' is not ideal.

Already working on it! 👍

zarino commented 8 years ago

@struan @mhl: Commit 31bb5384af1e215ff7acb74ba07cf19924dc2840 reverts all the custom dropdown menu styling and instead styles up the <select> element. If JavaScript is available, the submit button is hidden, and the form is automatically submitted whenever you change the <select> value.

language-switcher

Styling select boxes is the devil’s work, so I’ve tested this in IE8 and above, modern and old Firefox, and a few versions of Safari to check it all looks ok. In IE8–9 you get a duplication of dropdown arrows (one on the left, one on the right) but I think that's acceptable.

mhl commented 8 years ago

I think @wfdd's first point still needs to be addressed here - I'm assuming that's why the following fails: