diff options
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/app.js | 3 | ||||
-rw-r--r-- | src/js/arching-kaos-spa-router.js | 20 |
2 files changed, 9 insertions, 14 deletions
diff --git a/src/js/app.js b/src/js/app.js index c3e4c06..e246a19 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -19,8 +19,7 @@ window.addEventListener('resize', () => { // And call menuinit(); -// We bring up the default pane ( #welcome-section ) -document.querySelector('#welcome-section').hidden=false; +locationHashOnChange(); progressPlaceholder.value = '0'; diff --git a/src/js/arching-kaos-spa-router.js b/src/js/arching-kaos-spa-router.js index 03eac11..e5d5d2a 100644 --- a/src/js/arching-kaos-spa-router.js +++ b/src/js/arching-kaos-spa-router.js @@ -21,18 +21,14 @@ function locationHashGetter(){ } function locationHashOnChange(){ - if ( window.location.hash !== 'undefined' ){ - var route = new Object; - route.id = window.location.hash; - console.log(route); - menuinit(); - if ( menuids.includes(route.id.replace('/','')) ){ - document.querySelector(route.id.replace('/','')).hidden=false; - } else { - document.querySelector('#not-found-section').hidden=false; - } - //menusel(route); + var route = new Object; + route.id = locationHashGetter(); + menuinit(); + if ( (locationHashGetter() !== 'undefined') && (locationHashGetter() === '') ){ + document.querySelector('#welcome-section').hidden=false; + } else if ( (locationHashGetter() !== 'undefined') && ( menuids.includes(route.id.replace('/',''))) ){ + document.querySelector(route.id.replace('/','')).hidden=false; } else { - menuinit(); + document.querySelector('#not-found-section').hidden=false; } } |