diff --git a/src/static/css/App.css b/src/static/css/App.css index 06d42b8..e8ec674 100644 --- a/src/static/css/App.css +++ b/src/static/css/App.css @@ -149,6 +149,7 @@ a { font-size: 1.2rem; font-size: 1rem; background-color: rgb(156, 49, 45, .4); + cursor: pointer; } .navElement:hover { diff --git a/src/static/js/checkbox.js b/src/static/js/checkbox.js index d9f094d..ceb5e9c 100644 --- a/src/static/js/checkbox.js +++ b/src/static/js/checkbox.js @@ -1,4 +1,4 @@ -function toggle(dir) { +function toggleCheckbox(dir) { let toggles = document.querySelectorAll( ".checkbox-wrapper input[type=checkbox]" ); diff --git a/src/static/js/responsive.js b/src/static/js/responsive.js index 7a58e38..3cccfff 100644 --- a/src/static/js/responsive.js +++ b/src/static/js/responsive.js @@ -4,13 +4,6 @@ window.onload = function () { function onLoaded() { document.body.scrollTop = 0; // For Safari document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera - let navs = document.querySelectorAll(".navElement"); - navs.forEach(function (element) { - element.onclick = function () { - window.scrollTo(0, 0); - toggleMenu(); - }; - }); window.onresize = function () { resizer(); @@ -88,11 +81,9 @@ function toggleMenu() { } } -const loc = "https://asimonson.com" -// const loc = 'http://127.0.0.1:5000' - -async function goto(location, push=true) { - let a = await fetch(loc + "/api/goto/" + location, { +async function goto(location, {push=true, toggle=true}={}) { + console.log(toggle) + let a = await fetch("/api/goto/" + location, { credentials: "include", method: "GET", mode: "cors", @@ -106,6 +97,10 @@ async function goto(location, push=true) { eval(x.innerHTML); }); document.querySelector("title").textContent = metadata['title']; + window.scrollTo(0, 0); + if(toggle){ + toggleMenu(); + } if(push){ history.pushState(null, null, metadata['canonical']); } @@ -113,5 +108,5 @@ async function goto(location, push=true) { function backButton() { const location = window.location.pathname; - goto(location.substring(1), push=false); // remove slash, goto already does that -} \ No newline at end of file + goto(location.substring(1), {push:false}); // remove slash, goto already does that +} diff --git a/src/templates/about.html b/src/templates/about.html index 933371a..fb3fd91 100644 --- a/src/templates/about.html +++ b/src/templates/about.html @@ -90,7 +90,7 @@
@@ -99,20 +99,20 @@