fix: fallbacks for navbar hiding

main
Julian Lam 3 years ago
parent 0467ee9a6e
commit caf5d18238

@ -18,7 +18,7 @@ define('forum/account/theme', ['forum/account/header', 'storage', 'settings', 'a
document.getElementById('persona:menus:legacy-layout').checked = sidebarSwapped; document.getElementById('persona:menus:legacy-layout').checked = sidebarSwapped;
try { try {
const parsed = JSON.parse(autohideNavbarEnvs); const parsed = JSON.parse(autohideNavbarEnvs) || ['xs', 'sm'];
parsed.forEach((env) => { parsed.forEach((env) => {
const optionEl = document.getElementById('persona:navbar:autohide').querySelector(`option[value="${env}"]`); const optionEl = document.getElementById('persona:navbar:autohide').querySelector(`option[value="${env}"]`);
optionEl.selected = true; optionEl.selected = true;

Loading…
Cancel
Save