[WebUI] Fix legacy web UI mobile menu + Add menu items#1190
Conversation
…t he DOM. Reinsert them as script DOM nodes
|
|
||
| <!-- Burger Bar Control --> | ||
| <script defer type="text/javascript" src="./js/header.js"></script> | ||
| <script defer type="text/javascript" src="./js/header.js?_=2"></script> |
There was a problem hiding this comment.
what is the purpose of the ?_=2?
There was a problem hiding this comment.
This makes sure if someone has loaded the header recently and has it cached that it will force the browser to refetch the file (ignore cache). I've also used v=2 to try to make that more clear in other sites, but I wasn't intending on starting versioning for that file as someone may miss this little detail between updates.
Instead I use _ to suggest this parameter value is not important to being passed in.
Although technically I don't think this JavaScript was being executed/fetched in the current site so in this case it might not actually do anything!
We could certainly get more into this topic, but it won't matter when the site goes to using vite as it uses a new css/file hash for each build. (Files are hashed on the output of the bundler rollup): https://vite.dev/guide/build.html#advanced-base-options
Read more on the cache busting I did above with _= here: (they use ver)
https://www.keycdn.com/support/what-is-cache-busting#using-cache-busting-with-a-cdn
- Update touched files to newer const/let - Update `load` method for html files with JS - Update header to include github + client library links to desktop and mobile
This PR adds new header links for the client-side libraries.
I also noticed the mobile menu was not working. If you attempt to tap it currently nothing happens visually.
It looks as if the JavaScript for the event listener was not being loaded. Updated the
load()method to account for this.Brief Summary of Changes
loadmethod for html files with JSTesting
I ran the index.html using VSCode's live server to ensure it rendered as expected on mobile and desktop:
Mobile Menu
Desktop Menu