Mercurial > hg > batmud > maputils
changeset 2399:6a29605d1e2d
Change map URL when changing locations in the HTML+JS map location selector.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 09 Nov 2021 03:12:58 +0200 |
parents | 37b2acb15a40 |
children | 8a4358b3891f |
files | src/util.js |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/util.js Tue Nov 09 02:46:48 2021 +0200 +++ b/src/util.js Tue Nov 09 03:12:58 2021 +0200 @@ -226,6 +226,15 @@ } mapSetActiveLocation(newLoc); + + // Set href + var slink = window.location.href; + var spos; + if ((spos = slink.indexOf("#")) >= 0) + slink = slink.substr(0, spos); + slink += newLoc != null ? "#" + newLoc : ""; + + window.location.href = slink; }