feat(frontend): add button to clear configuration
This commit is contained in:
parent
b6ef022f15
commit
41e5fd5f13
@ -169,11 +169,20 @@ function select_class() {
|
|||||||
Cookies.set("class", student_class);
|
Cookies.set("class", student_class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function delete_cookies() {
|
||||||
|
Cookies.remove("id");
|
||||||
|
Cookies.remove("type");
|
||||||
|
Cookies.remove("teacher");
|
||||||
|
Cookies.remove("class");
|
||||||
|
}
|
||||||
|
|
||||||
if (Cookies.get("id") && Cookies.get("type")) {
|
if (Cookies.get("id") && Cookies.get("type")) {
|
||||||
if (Cookies.get("type") === "teacher" && Cookies.get("teacher")) {
|
if (Cookies.get("type") === "teacher" && Cookies.get("teacher")) {
|
||||||
make_teacher_table(Cookies.get("id"), Cookies.get("teacher"));
|
make_teacher_table(Cookies.get("id"), Cookies.get("teacher"));
|
||||||
|
document.getElementById("dashboard").removeAttribute("hidden");
|
||||||
} else if (Cookies.get("type") === "student" && Cookies.get("class")) {
|
} else if (Cookies.get("type") === "student" && Cookies.get("class")) {
|
||||||
make_student_table(Cookies.get("id"), Cookies.get("class"));
|
make_student_table(Cookies.get("id"), Cookies.get("class"));
|
||||||
|
document.getElementById("dashboard").removeAttribute("hidden");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
document.getElementById("forms").removeAttribute("hidden");
|
document.getElementById("forms").removeAttribute("hidden");
|
||||||
|
@ -64,7 +64,12 @@
|
|||||||
</formfield>
|
</formfield>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<table id="table" class="striped"></table>
|
<div id="dashboard" hidden>
|
||||||
|
<table id="table" class="striped"></table>
|
||||||
|
<form>
|
||||||
|
<input type="submit" onclick="delete_cookies()" value="Reimposta" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user