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:
23
static/js/editStorages.js
Normal file
23
static/js/editStorages.js
Normal 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;
|
||||
})
|
Reference in New Issue
Block a user