X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/91a9738ee8553aa71610c911e7cb3a829f035087..490226ad6d28cf9eff1fc78c7c69bef750321614:/app/views/site/_potlatch.html.erb diff --git a/app/views/site/_potlatch.html.erb b/app/views/site/_potlatch.html.erb index 9dcceeb9b..2cdccc4b0 100644 --- a/app/views/site/_potlatch.html.erb +++ b/app/views/site/_potlatch.html.erb @@ -44,7 +44,13 @@ doSWF(<%= @lat || 'null' %>,<%= @lon || 'null' %>,<%= @zoom %>); - function setPosition(lat, lon, zoom) { - doSWF(lat, lon, zoom || 15); - } + $(document).ready(function () { + $("body").on("click", "a.set_position", function () { + var lat = parseFloat($(this).attr("data-lat")); + var lon = parseFloat($(this).attr("data-lon")); + var zoom = parseInt($(this).attr("data-zoom")); + + doSWF(lat, lon, zoom || 15); + }); + });