From 1d2f4b6e372f5d756ea5dc14c2624b492bef0432 Mon Sep 17 00:00:00 2001 From: Radek Stepan Date: Wed, 21 Aug 2013 17:21:23 +0100 Subject: [PATCH] hash support --- src/app.coffee | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app.coffee b/src/app.coffee index 946ea44..4470e69 100644 --- a/src/app.coffee +++ b/src/app.coffee @@ -28,7 +28,11 @@ route = -> render 'body', 'info' module.exports = -> - # Detect route changes. - window.addEventListener 'hashchange', route, no - # And route now. - do route \ No newline at end of file + # Do we have browser support? + if 'onhashchange' of window and 'hash' of window.location + # Detect route changes. + window.addEventListener 'hashchange', route, no + # And route now. + return do route + + render 'body', 'error', { text: 'URL fragment identifier not supported' } \ No newline at end of file