fix(setuppage): 🐛 Fix select lingua

This commit is contained in:
Maicol Battistini 2021-12-01 18:28:54 +01:00
parent 74796fabc5
commit fa42daf2b9
No known key found for this signature in database
GPG Key ID: 4FDB0F87CDB1D34A
1 changed files with 5 additions and 2 deletions

View File

@ -208,7 +208,7 @@ export default class SetupPage extends Page {
.toggleClass('mdc-high-contrast');
});
$('mwc-select#language-select').on('action', this.onLanguageSelected);
$('#language-select').on('action', this.onLanguageSelected);
// Fix for mwc button inside <a> tags
$('a')
@ -226,7 +226,10 @@ export default class SetupPage extends Page {
}
onLanguageSelected(event: Event) {
window.location.href = window.route('app.language', {language: event.target.value});
const {detail, target: select} = event;
const selected = $(select).find(`mwc-list-item:nth-child(${detail.index + 1}) [slot="graphic"] img`);
$(select).find('[slot="icon"] img').attr('src', selected.attr('src'));
window.location.href = window.route('app.language', {language: select.value});
}
async testDatabase(silentSuccess = false, silentError = false): boolean {