forked from jeffalo/kahoot-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserInterface.js
47 lines (43 loc) · 1.21 KB
/
UserInterface.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
function openNav() {
// Displays the side navigation panel
document.getElementById("sidenav").style.width = "250px";
}
function closeNav() {
// Closes the side navigation panel
document.getElementById("sidenav").style.width = "0";
}
function toggleShow() {
// Displays/Hides the program status text area
var x = document.getElementById("status");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
function openSettings() {
// Displays/Hides the advanced settings panel
var x = document.getElementById("settings");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
document.location.href = "#settings";
}
function disableNameInput(disable) {
// Disables or enables the name input
let nameInput = document.getElementById("name-input");
disable == true
? (nameInput.value =
"You chose to enter a list of names. You can leave this blank.")
: (nameInput.value = nameInput.value);
nameInput.disabled = disable;
}
module.exports = {
openNav: openNav,
closeNav: closeNav,
toggleShow: toggleShow,
openSettings: openSettings,
disableNameInput: disableNameInput
};