Skip to content

Instantly share code, notes, and snippets.

@philoye
philoye / router.coffee
Created May 31, 2012 04:28 — forked from toolmantim/router.coffee
A Backbone.js router subclass that disables the hash fallback mechanism in favour of just navigating to the location (just like a normal link would behave)
class MyApp.Router extends Backbone.Router
hasPushState: window.history and window.history.pushState
# Override the navigate function to remove Backbone's #hash fallback for
# non-pushState browsers. Instead we just navigate to the new location using
# window.location
navigate: (fragment, trigger) ->
if @hasPushState
super(arguments...)