Use location instead of window.location and document.location

This commit is contained in:
Anton Khorev 2025-03-01 12:01:31 +03:00
parent c37dc5c56d
commit 4e9483e5eb
14 changed files with 27 additions and 27 deletions

View file

@ -12,7 +12,7 @@ OSM.Changeset = function (map) {
const changesetData = content.find("[data-changeset]").data("changeset");
changesetData.type = "changeset";
const hashParams = OSM.parseHash(window.location.hash);
const hashParams = OSM.parseHash(location.hash);
initialize();
map.addObject(changesetData, function (bounds) {
if (!hashParams.center && bounds.isValid()) {
@ -45,7 +45,7 @@ OSM.Changeset = function (map) {
});
})
.then(() => {
OSM.loadSidebarContent(window.location.pathname, page.load);
OSM.loadSidebarContent(location.pathname, page.load);
})
.catch(error => {
content.find("button[data-method][data-url]").prop("disabled", false);