swipely / aviator

Aviator is a single-page front-end router built for modularity.
MIT License
143 stars 6 forks source link

Allow specification of never using hash routes #72

Open flahertyb opened 8 years ago

flahertyb commented 8 years ago

Some folks might not want to use hash routes, even if the browser doesn't support push state. So I've added a change such that you can specify fallbackToHashRoutes as false. Specifying this option means:

Aviator.dispatch() would still perform the right action based on the url, but calls to navigate trigger full page refreshes, links work as normal, and Aviator doesn't intercept calls to the back button.

With this commit, we are skipping the whole _attachEvents step. To actually have links work as normal, when a root is specified, we need to actually still intercept navigate link clicks so as to prepend the root.

@barnabyc @hojberg @nahiluhmot

flahertyb commented 8 years ago

So, still need a commit to fix that link/root situation, and to fix these tests. Curious what y'all think though.