Skip to content
Snippets Groups Projects
Commit 971c6be4 authored by Thijs Kinkhorst's avatar Thijs Kinkhorst
Browse files

Make select submit on change and label it for a11y

(cherry picked from commit aa4a29ea)
parent 2fca9b74
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<div class="pure-control-group"> <div class="pure-control-group">
<label for="organization">{{ 'Organization'|trans }}</label> <label for="organization">{{ 'Organization'|trans }}</label>
<div class="pure-select right pure-input-1-2 pure-input-sm-1-1"> <div class="pure-select right pure-input-1-2 pure-input-sm-1-1">
<select name="organization" class="" id="organization" tabindex="3"> <select name="organization" id="organization" tabindex="3">
{{ selectedOrg ?: null }} {{ selectedOrg ?: null }}
{%- for id, orgDesc in organizations -%} {%- for id, orgDesc in organizations -%}
{% if id == selectedOrg -%} {% if id == selectedOrg -%}
......
...@@ -6,6 +6,10 @@ import php from "highlight.js/lib/languages/php"; ...@@ -6,6 +6,10 @@ import php from "highlight.js/lib/languages/php";
import json from "highlight.js/lib/languages/json"; import json from "highlight.js/lib/languages/json";
$(document).ready(function () { $(document).ready(function () {
$('#language-selector').on('change', function () {
$("#language-form").submit();
});
// side menu // side menu
$('#menuLink').click(function (e) { $('#menuLink').click(function (e) {
e.preventDefault(); e.preventDefault();
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<input type="hidden" name="{{ name }}" /> <input type="hidden" name="{{ name }}" />
{% endif %} {% endif %}
{% endfor %} {% endfor %}
<select class="pure-input-1-4 language-menu" name="language" id="language-selector"> <select aria-label="{% trans %}Language{% endtrans %}" class="pure-input-1-4 language-menu" name="language" id="language-selector">
{% for key, lang in languageBar %} {% for key, lang in languageBar %}
{% if key == currentLanguage %} {% if key == currentLanguage %}
<option value="{{ key }}" selected="selected">&#xf0ac; {{ lang.name }}</option> <option value="{{ key }}" selected="selected">&#xf0ac; {{ lang.name }}</option>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment