]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/application.js
Replace $(document).ready(...) with $(...)
[rails.git] / app / assets / javascripts / application.js
index 4c9aa8b91ad3950dc4bfac1f7ff252a1575b930e..e07830d4ea7c7a010ffe5426732298997c5249aa 100644 (file)
@@ -11,7 +11,6 @@
 //= require leaflet.zoom
 //= require leaflet.locationfilter
 //= require i18n
-//= require oauth
 //= require matomo
 //= require richtext
 
@@ -85,7 +84,7 @@ window.updateLinks = function (loc, zoom, layers, object) {
     .toggleClass("disabled", editDisabled);
 };
 
-$(document).ready(function () {
+$(function () {
   // NB: Turns Turbo Drive off by default. Turbo Drive must be opt-in on a per-link and per-form basis
   // See https://turbo.hotwired.dev/reference/drive#turbo.session.drive
   Turbo.session.drive = false;
@@ -96,6 +95,9 @@ $(document).ready(function () {
         breakpointWidth = 768;
   let moreItemWidth = 0;
 
+  OSM.csrf = {};
+  OSM.csrf[($("meta[name=csrf-param]").attr("content"))] = $("meta[name=csrf-token]").attr("content");
+
   function updateHeader() {
     const windowWidth = $(window).width();