ui: avoid html insertion for settings fragment

This commit is contained in:
a.tolmachev
2026-05-02 13:31:50 +00:00
parent 2f84a38b69
commit 3a4dddd071
+5 -2
View File
@@ -196,11 +196,14 @@ function injectLanguageSwitcher() {
fetch('html/fragments/lang-switcher.html')
.then(function(response) { return response.text(); })
.then(function(html) {
var template = document.createElement('template');
template.innerHTML = html;
var fragment = template.content.cloneNode(true);
var saveRow = cardBody.querySelector('div[style*="justify-content:flex-end"]');
if (saveRow) {
saveRow.insertAdjacentHTML('beforebegin', html);
saveRow.parentNode.insertBefore(fragment, saveRow);
} else {
cardBody.insertAdjacentHTML('beforeend', html);
cardBody.appendChild(fragment);
}
if (typeof applyLang === 'function') {
applyLang();