X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b0348093f8877d2f59f153bf35e87ba411f4004b..b8b9c3d1e9e412178426e9ba1b612e14e09f2320:/app/assets/javascripts/application.js diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 464bbecee..e07830d4e 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -11,7 +11,6 @@ //= require leaflet.zoom //= require leaflet.locationfilter //= require i18n -//= require oauth //= require matomo //= require richtext @@ -76,7 +75,7 @@ window.updateLinks = function (loc, zoom, layers, object) { // Disable the button group and also the buttons to avoid // inconsistent behaviour when zooming - var editDisabled = zoom < 13; + const editDisabled = zoom < 13; $("#edit_tab") .tooltip({ placement: "bottom" }) .tooltip(editDisabled ? "enable" : "disable") @@ -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,8 +95,11 @@ $(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() { - var windowWidth = $(window).width(); + const windowWidth = $(window).width(); if (windowWidth < breakpointWidth) { $("body").addClass("small-nav");