hash support

This commit is contained in:
Radek Stepan 2013-08-21 17:21:23 +01:00
parent 20257e0875
commit 1d2f4b6e37
1 changed files with 8 additions and 4 deletions

View File

@ -28,7 +28,11 @@ route = ->
render 'body', 'info' render 'body', 'info'
module.exports = -> module.exports = ->
# Detect route changes. # Do we have browser support?
window.addEventListener 'hashchange', route, no if 'onhashchange' of window and 'hash' of window.location
# And route now. # Detect route changes.
do route window.addEventListener 'hashchange', route, no
# And route now.
return do route
render 'body', 'error', { text: 'URL fragment identifier not supported' }