diff options
Diffstat (limited to 'src/js/arching-kaos-spa-router.js')
-rw-r--r-- | src/js/arching-kaos-spa-router.js | 20 |
1 files changed, 8 insertions, 12 deletions
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; } } |