aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/js/arching-kaos-spa-router.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/js/arching-kaos-spa-router.js b/src/js/arching-kaos-spa-router.js
index e5d5d2a..162f1e2 100644
--- a/src/js/arching-kaos-spa-router.js
+++ b/src/js/arching-kaos-spa-router.js
@@ -22,12 +22,15 @@ function locationHashGetter(){
function locationHashOnChange(){
var route = new Object;
- route.id = locationHashGetter();
+ route.full = locationHashGetter();
+ route.args = route.full.split('/');
+ route.menuid = '#'+route.args[1];
+ route.subcommand = route.args[2];
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 if ( (locationHashGetter() !== 'undefined') && ( menuids.includes(route.menuid))){
+ document.querySelector(route.menuid).hidden=false;
} else {
document.querySelector('#not-found-section').hidden=false;
}