diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-05 01:02:20 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-05 01:02:20 -0500 |
| commit | 4a04a1129fffd1e128e53ba7886777c8d7b36b55 (patch) | |
| tree | 79d394f2e14909e234ce8ffb9e1dfe5244678d23 /StoneIsland/www/js/vendor/view/router.js | |
| parent | 83517eb8d489cfceda8e6b7ab1b104a8f0b1f3a8 (diff) | |
populate product view
Diffstat (limited to 'StoneIsland/www/js/vendor/view/router.js')
| -rw-r--r-- | StoneIsland/www/js/vendor/view/router.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/StoneIsland/www/js/vendor/view/router.js b/StoneIsland/www/js/vendor/view/router.js index d766880f..a8ec331f 100644 --- a/StoneIsland/www/js/vendor/view/router.js +++ b/StoneIsland/www/js/vendor/view/router.js @@ -14,8 +14,10 @@ var Router = View.extend({ }, parseRoute: function(pathname){ - - if (pathname[0] !== "/" && pathname[0] !== "#") { pathname = "/" + pathname } + + pathname = pathname.replace(/^#/, "") + + if (pathname[0] !== "/") { pathname = "/" + pathname } var routes = this.routes, path = pathname.split("/"); @@ -25,7 +27,7 @@ var Router = View.extend({ path[i] = null } } - + if (pathname in routes) { this[this.routes[pathname]]() return |
