Skip to content

Commit

Permalink
jsrouting: clear search boxes on page unload
Browse files Browse the repository at this point in the history
  • Loading branch information
danstowell committed Mar 9, 2014
1 parent 42c1dec commit bc67479
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/assets/javascripts/router.js
Expand Up @@ -174,6 +174,9 @@ OSM.Router = function(map, rts) {

map.on('moveend baselayerchange overlaylayerchange', router.updateHash);
$(window).on('hashchange', router.hashUpdated);
$(window).on('unload', function(e) {
$(".query_wrapper.routing input").val("");
});

return router;
};

2 comments on commit bc67479

@jfirebaugh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danstowell What's the rationale for this?

@jfirebaugh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, found it: https://github.com/systemed/openstreetmap-website/pull/17. I'm working on permalinks for directions. Once that's implemented, going back will show you the whole route again, so it will make sense to keep the input values around.

Please sign in to comment.