Updated styles and Added storageManager.

- Dark/White-mode support
- Collapsible navs
- Renamed items template.
- StorageBuilding's are now StorageUnit's
- Formatting, general cleanup, some bug fixing.
This commit is contained in:
2023-05-12 23:57:21 +02:00
parent 96853debe2
commit 3569c9ed4b
14 changed files with 236 additions and 65 deletions

23
static/js/editStorages.js Normal file
View File

@ -0,0 +1,23 @@
// Javascript to enable link to tab
// This magic js codes enables anchor links to work with bootstrap tabs
// Taken from https://stackoverflow.com/a/9393768/11317151 (and edited, like a lot)
// Also update on location change
window.addEventListener("hashchange", function() {
var hash = location.hash.replace(/^#/, ''); // ^ means starting, meaning only match the first hash
if (hash) {
bootstrap.Tab.getOrCreateInstance(document.querySelector('#' + hash)).show()
}
}, false);
var hash = location.hash.replace(/^#/, ''); // ^ means starting, meaning only match the first hash
if (hash) {
bootstrap.Tab.getOrCreateInstance(document.querySelector('#' + hash)).show()
}
// Change hash for page-reload
$('.nav-link').on('click', function (e) {
window.location.hash = e.target.id;
})