]> git.openstreetmap.org Git - rails.git/commit
only parse hashParams if there is a hash
authorMartin Raifer <martin@raifer.tech>
Tue, 14 Jun 2022 18:41:10 +0000 (20:41 +0200)
committerGitHub <noreply@github.com>
Tue, 14 Jun 2022 18:41:10 +0000 (20:41 +0200)
commit66656e1d1d58e6073efd453007d7452920531b37
tree5caeaf5d67667886c48260109450dd3d0126aaee
parent9adad9f90df122de58ffde3818c8b6c46d2d4b01
only parse hashParams if there is a hash

Presumably this was an oversight in the original implementation, as `OSM.params` falls back to the page's `query` string if the function's parameter (here: the page's `hash`) is an empty string.

This fixes some inconsistent behaviour of the website. In the example below, the first URL sets the `background` to `none` while in the second example it doesn't.

* https://www.openstreetmap.org/edit.html?background=none
* https://www.openstreetmap.org/edit.html?background=none#map=…
app/assets/javascripts/edit/id.js.erb