X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/51a2d85053b67b2bc842fa45ac8eb998f8585add..248b5fa1aefb8c7b4ece818ad3720992f2487fe2:/app/assets/javascripts/index.js?ds=sidebyside diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 96870f600..c5bddbaec 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -24,7 +24,7 @@ //= require index/home //= require router -$(document).ready(function () { +$(function () { const map = new L.OSM.Map("map", { zoomControl: false, layerControl: false, @@ -311,7 +311,7 @@ $(document).ready(function () { }; function addObject(type, id, version, center) { - const hashParams = OSM.parseHash(window.location.hash); + const hashParams = OSM.parseHash(location.hash); map.addObject({ type: type, id: parseInt(id, 10), version: version && parseInt(version, 10) }, function (bounds) { if (!hashParams.center && bounds.isValid() && (center || !map.getBounds().contains(bounds))) { @@ -363,7 +363,7 @@ $(document).ready(function () { "/account/home": OSM.Home(map) }); - if (OSM.preferred_editor === "remote" && document.location.pathname === "/edit") { + if (OSM.preferred_editor === "remote" && location.pathname === "/edit") { remoteEditHandler(map.getBounds(), params.object); OSM.router.setCurrentPath("/"); }