Allow disabling theme picker

This commit is contained in:
Svilen Markov
2025-05-16 18:08:36 +01:00
parent b294839b79
commit b4094b28bd
5 changed files with 60 additions and 37 deletions

View File

@@ -689,12 +689,15 @@ async function changeTheme(key, onChanged) {
setTimeout(() => { tempStyle.remove(); }, 10);
}
function initThemeSwitcher() {
function initThemePicker() {
const themeChoicesInMobileNav = find(".mobile-navigation .theme-choices");
if (!themeChoicesInMobileNav) return;
const themeChoicesInHeader = find(".header-container .theme-choices");
if (themeChoicesInHeader) {
themeChoicesInHeader.replaceWith(
find(".mobile-navigation .theme-choices").cloneNode(true)
themeChoicesInMobileNav.cloneNode(true)
);
}
@@ -739,7 +742,7 @@ function initThemeSwitcher() {
}
async function setupPage() {
initThemeSwitcher();
initThemePicker();
const pageElement = document.getElementById("page");
const pageContentElement = document.getElementById("page-content");