X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/4d91fe3dd95c1058cb8d24fd4c900223e30b9059..f48d8f41d8e4f85759ec8150da31fd86b18ea253:/app/assets/javascripts/application.js?ds=sidebyside diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 71eb71711..c52c072a7 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -6,18 +6,13 @@ //= require augment //= require openlayers //= require i18n/translations -//= require globals -//= require params +//= require osm //= require piwik -//= require browse -//= require export //= require map -//= require key //= require menu //= require sidebar //= require richtext //= require resize -//= require notes function zoomPrecision(zoom) { var decimals = Math.pow(10, Math.floor(zoom/3)); @@ -30,7 +25,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; @@ -59,8 +54,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"); @@ -88,8 +83,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. @@ -104,7 +99,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;