]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.share.js
Make context menu use from/to for directions
[rails.git] / app / assets / javascripts / leaflet.share.js
index a6b10821e868bc603da0b1d4e0bff296cf945818..7cfd50c8e23e09eb7fcc550ca159797e92a797d3 100644 (file)
@@ -213,6 +213,15 @@ L.OSM.share = function (options) {
       .attr('type', 'hidden')
       .appendTo($form);
 
       .attr('type', 'hidden')
       .appendTo($form);
 
+    var csrf_param = $("meta[name=csrf-param]").attr("content"),
+        csrf_token = $("meta[name=csrf-token]").attr("content");
+
+    $('<input>')
+      .attr('name', csrf_param)
+      .attr('value', csrf_token)
+      .attr('type', 'hidden')
+      .appendTo($form);
+
     $('<p>')
       .attr('class', 'deemphasize')
       .html(I18n.t('javascripts.share.image_size') + ' <span id="mapnik_image_width"></span> x <span id="mapnik_image_height"></span>')
     $('<p>')
       .attr('class', 'deemphasize')
       .html(I18n.t('javascripts.share.image_size') + ' <span id="mapnik_image_width"></span> x <span id="mapnik_image_height"></span>')