//= require index/home
//= require router
-$(document).ready(function () {
+$(function () {
const map = new L.OSM.Map("map", {
zoomControl: false,
layerControl: false,
};
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))) {
"/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("/");
}