mikko-apo/ki-router.js — pull request #2 by jliuhtonen (2014-09-24 13:56:07+00:00)
Title: Fix running routes twice when on hashchangeSupport

When hashchangeSupport was used without disableUrlUpdate, the routes were
executed twice. This was because in the click handler the route was first
executed and after that the window.location.hash was updated. This triggered
window.hashchange event listener, which executed the route again.

This commit includes the following changes:
* In the click handler the route is first fetched
using find. If a route was found, and we are using pushState or
disableUrlUpdate, the route is executed with execRoute(). After that the url is
updated, except when disableUrlUpdate is turned on.
* A few other local refactorings