X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a56d1036d58d45777d6adeffd5a950519bc70318..9029e47ce9e41a220710d117868e14d8cd1c719a:/app/assets/javascripts/router.js diff --git a/app/assets/javascripts/router.js b/app/assets/javascripts/router.js index 7b2e99546..654ec860b 100644 --- a/app/assets/javascripts/router.js +++ b/app/assets/javascripts/router.js @@ -11,7 +11,7 @@ OSM.Router = function(rts) { .replace(namedParam, function(match, optional){ return optional ? match : '([^\/]+)'; }) - .replace(splatParam, '(.*?)') + '(?:$|[?#])'); + .replace(splatParam, '(.*?)') + '(?:\\?.*)?$'); var route = {}; @@ -44,14 +44,14 @@ OSM.Router = function(rts) { } }; - var currentPath = window.location.pathname, + var currentPath = window.location.pathname + window.location.search, currentRoute = routes.recognize(currentPath); currentRoute.run('load', currentPath); if (window.history && window.history.pushState) { $(window).on('popstate', function() { - var path = window.location.pathname; + var path = window.location.pathname + window.location.search; if (path === currentPath) return; currentRoute.run('unload'); currentPath = path;