-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.js
57 lines (32 loc) · 1.15 KB
/
menu.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* Handle the menu and settings on every page
*
* @author Anthony Wilson
*/
"use strict";
//Open/close the overflow menu
var toggleOverflowMenu = () => {
const overflowMenu = document.getElementById("overflow-menu");
var overflowBtn = document.getElementById("nav-menu-btn");
var dimmer = document.getElementById("dimmer");
//Check the value of the custom "settingsopen" attribute on the element
if(overflowBtn.getAttribute("menuopen") == "true"){
overflowBtn.setAttribute("menuopen", "false");
overflowMenu.hidden = true;
dimmer.hidden = true;
}else{
overflowBtn.setAttribute("menuopen", "true");
overflowMenu.hidden = false;
dimmer.hidden = false;
}
}
//Add the options fo the color theme selector in the overflow menu
var populateColorThemeSelector = () => {
var colorThemeSelect = document.getElementById("settings-color-theme-select");
for(var t = 0;t < colorThemes.length;t ++){
var option = document.createElement("option");
option.value = t.toString();
option.innerHTML = colorThemes[t].name;
colorThemeSelect.appendChild(option);
}
}