Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
inventionpro authored Oct 22, 2024
1 parent 89d8e50 commit 4af55d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion media/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ function ObjectToTree(obj, prefix) {
}
function side() {
const ls = document.getElementById('lang-select');
ls.innerHTML = Object.keys(data).map(l=>`<option value="${l}"${ls?.value===l?' selected':''}>${l}${main==l?' (main)':''}</option>`).sort().join('');
let before = ls.value ?? '';
ls.innerHTML = Object.keys(data).map(l=>`<option value="${l}"${before===l?' selected':''}>${l}${main==l?' (main)':''}</option>`).sort().join('');
document.getElementById('tree').innerHTML = ObjectToTree(data[main]??(data[Object.keys(data)[0]]??{}), '');
}
window.side = side;
Expand Down

0 comments on commit 4af55d2

Please sign in to comment.