summaryrefslogtreecommitdiffstats
path: root/target/doc/theme.js
blob: 3e7a5bebeecda986e1224d6678cae63c3b5347e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var themes = document.getElementById("theme-choices");
var themePicker = document.getElementById("theme-picker");
themePicker.onclick = function() {
    if (themes.style.display === "block") {
        themes.style.display = "none";
        themePicker.style.borderBottomRightRadius = "3px";
        themePicker.style.borderBottomLeftRadius = "3px";
    } else {
        themes.style.display = "block";
        themePicker.style.borderBottomRightRadius = "0";
        themePicker.style.borderBottomLeftRadius = "0";
    }
};
["dark","light"].forEach(function(item) {
    var but = document.createElement('button');
    but.innerHTML = item;
    but.onclick = function(el) {
        switchTheme(currentTheme, mainTheme, item);
    };
    themes.appendChild(but);
});