Last active
September 15, 2016 22:43
-
-
Save mu-arch/60db1d36cd59e5fb4fff44d999475b84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var router = new Navigo(useHash=false); | |
router | |
.on({ | |
'login': function () { | |
setContent('login'); | |
}, | |
'recover': function () { | |
setContent('recover'); | |
}, | |
'signup': function () { | |
setContent('signup'); | |
}, | |
'people': function () { | |
setContent('people'); | |
} | |
}); | |
router.notFound(function () { | |
router.navigate('/login'); | |
}); | |
window.addEventListener('load', function() { | |
console.log('WINDOW LOAD'); | |
router.resolve(); | |
}); | |
// Templater | |
function setContent(id) { | |
document.id('view').innerHTML = document.id('view-' + id).innerHTML; | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment