X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e338d1140884bb2bf3ed1b8fc85c890d0937ef8c..8435b1bf60e0b4e2de092213ad6965793c6db190:/app/assets/javascripts/application.js?ds=sidebyside diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 148855dd8..8d6c13503 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -2,15 +2,17 @@ //= require jquery_ujs //= require jquery.autogrowtextarea //= require jquery.timers +//= require jquery.cookie //= require augment -//= require openlayers +//= require leaflet +//= require leaflet.osm +//= require leaflet.locationfilter +//= require leaflet.pan +//= require leaflet.zoom //= require i18n/translations -//= require globals +//= require osm //= require piwik -//= require browse -//= require export //= require map -//= require key //= require menu //= require sidebar //= require richtext @@ -27,7 +29,7 @@ function zoomPrecision(zoom) { * Called as the user scrolls/zooms around to aniplate hrefs of the * view tab and various other links */ -function updatelinks(lon,lat,zoom,layers,minlon,minlat,maxlon,maxlat,objtype,objid) { +function updatelinks(lon,lat,zoom,layers,minlon,minlat,maxlon,maxlat,object) { var toPrecision = zoomPrecision(zoom); var node; @@ -56,8 +58,8 @@ function updatelinks(lon,lat,zoom,layers,minlon,minlat,maxlon,maxlat,objtype,obj args.layers = layers; } - if (objtype && $(link).hasClass("object")) { - args[objtype] = objid; + if (object && $(link).hasClass("object")) { + args[object.type] = object.id; } var minzoom = $(link).data("minzoom"); @@ -85,8 +87,8 @@ function updatelinks(lon,lat,zoom,layers,minlon,minlat,maxlon,maxlat,objtype,obj var prefix = shortlinkPrefix(); // Add ?{node,way,relation}=id to the arguments - if (objtype && objid) { - args[objtype] = objid; + if (object) { + args[object.type] = object.id; } // This is a hack to omit the default mapnik layer from the shortlink. @@ -101,7 +103,7 @@ function updatelinks(lon,lat,zoom,layers,minlon,minlat,maxlon,maxlat,objtype,obj // ?{node,way,relation}= can be safely omitted from the shortlink // which encodes lat/lon/zoom. If new URL parameters are added to // the main slippy map this needs to be changed. - if (args.layers || args[objtype]) { + if (args.layers || object) { this.href = setArgs(prefix + "/go/" + code, args); } else { this.href = prefix + "/go/" + code;