1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix language dropdown

This commit is contained in:
Luke Pulverenti 2015-11-29 14:44:15 -05:00
parent 3c30ee6e81
commit 039dcc8f8c
24 changed files with 154 additions and 82 deletions

View file

@ -58,9 +58,41 @@
load(page, config, allCultures, allCountries);
});
function populateLanguages(select, languages) {
var html = "";
html += "<option value=''></option>";
for (var i = 0, length = languages.length; i < length; i++) {
var culture = languages[i];
html += "<option value='" + culture.TwoLetterISOLanguageName + "'>" + culture.DisplayName + "</option>";
}
select.innerHTML = html;
}
function populateCountries(select, allCountries) {
var html = "";
html += "<option value=''></option>";
for (var i = 0, length = allCountries.length; i < length; i++) {
var culture = allCountries[i];
html += "<option value='" + culture.TwoLetterISORegionName + "'>" + culture.DisplayName + "</option>";
}
select.innerHTML = html;
}
ApiClient.getCultures().then(function (result) {
Dashboard.populateLanguages($('#selectLanguage', page), result);
populateLanguages(page.querySelector('#selectLanguage'), result);
allCultures = result;
load(page, config, allCultures, allCountries);
@ -68,7 +100,7 @@
ApiClient.getCountries().then(function (result) {
Dashboard.populateCountries($('#selectCountry', page), result);
populateCountries(page.querySelector('#selectCountry'), result);
allCountries = result;
load(page, config, allCultures, allCountries);