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=
This commit is contained in:
Martin Raifer 2022-06-14 20:41:10 +02:00 committed by GitHub
parent 9adad9f90d
commit 66656e1d1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,8 @@ $(document).ready(function () {
var id = $("#id-embed");
if (id.data("configured") === true) {
var hashParams = OSM.params(location.hash.substring(1));
var hash = location.hash.substring(1);
var hashParams = hash ? OSM.params(hash) : {};
var mapParams = OSM.mapParams();
var params = {};