From 6fd580e3f93308c2856755356c82aedf3503f5ea Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Fri, 23 Sep 2022 10:03:54 +0000 Subject: [PATCH] issue-fix (#32) Closes issues #22 & #26. Improves #23 but does not close it yet. Co-authored-by: fred.boniface Reviewed-on: https://git.fjla.uk/fred.boniface/athena.fb-infra.uk/pulls/32 --- error-pages/404.php | 6 ++++ js/nav.js | 36 +++++++++---------- manifest.json | 2 +- page-blocks/headers.php | 2 ++ page-blocks/nav-menu.php | 16 ++++----- php/version.php | 2 +- styles/style.css | 77 ++++++++++++++++++++++++++-------------- 7 files changed, 83 insertions(+), 58 deletions(-) diff --git a/error-pages/404.php b/error-pages/404.php index 1f760fc..3fcf538 100644 --- a/error-pages/404.php +++ b/error-pages/404.php @@ -14,6 +14,12 @@

Oh no! That page can't be found

+

+ If you got here from a homescreen icon on your device, you will + need to remove and re-add the button due to major upgrades to + the Athena application +

+

Go back to the homepage

404 - Not Found

diff --git a/js/nav.js b/js/nav.js index e14626c..6cbf18e 100644 --- a/js/nav.js +++ b/js/nav.js @@ -1,23 +1,19 @@ -function openMenu() { - document.getElementById("menu").style.display = "block"; +/* When the user clicks on the button, +toggle between hiding and showing the dropdown content */ +function myFunction() { + document.getElementById("myDropdown").classList.toggle("show"); } -function closeMenu() { - document.getElementById("menu").style.display = "none"; -} - -function closeAboutPopup() { - document.getElementById("popup-about").style.display = "none"; -} - -function openAboutPopup() { - document.getElementById("popup-about").style.display = "block"; -} - -function closeTiplocPopup() { - document.getElementById("popup-tiploc").style.display = "none"; -} - -function openTiplocPopup() { - document.getElementById("popup-tiploc").style.display = "block"; +// Close the dropdown menu if the user clicks outside of it +window.onclick = function(event) { + if (!event.target.matches('.dropbtn')) { + var dropdowns = document.getElementsByClassName("dropdown-content"); + var i; + for (i = 0; i < dropdowns.length; i++) { + var openDropdown = dropdowns[i]; + if (openDropdown.classList.contains('show')) { + openDropdown.classList.remove('show'); + } + } + } } diff --git a/manifest.json b/manifest.json index c8b18bd..33ab785 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "Athena", "short_name": "Athena", - "start_url": "/index.html", + "start_url": "/", "scope": "/", "display": "standalone", "background_color": "#7fa7e6", diff --git a/page-blocks/headers.php b/page-blocks/headers.php index 6f0a09f..bf814f0 100644 --- a/page-blocks/headers.php +++ b/page-blocks/headers.php @@ -8,3 +8,5 @@ echo ''; echo ''; echo ''; echo ''; + +echo ''; diff --git a/page-blocks/nav-menu.php b/page-blocks/nav-menu.php index 7ec96f1..df890f7 100644 --- a/page-blocks/nav-menu.php +++ b/page-blocks/nav-menu.php @@ -1,12 +1,10 @@ '; -echo ''; -echo '