]> git.openstreetmap.org Git - rails.git/commitdiff
Replace $(document).ready(...) with $(...)
authorAnton Khorev <tony29@yandex.ru>
Sat, 1 Mar 2025 13:20:48 +0000 (16:20 +0300)
committerAnton Khorev <tony29@yandex.ru>
Sat, 1 Mar 2025 13:20:48 +0000 (16:20 +0300)
12 files changed:
app/assets/javascripts/application.js
app/assets/javascripts/auth_providers.js
app/assets/javascripts/diary_entry.js
app/assets/javascripts/edit/id.js.erb
app/assets/javascripts/fixthemap.js
app/assets/javascripts/index.js
app/assets/javascripts/login.js
app/assets/javascripts/matomo.js
app/assets/javascripts/messages.js
app/assets/javascripts/social_share_button.js
app/assets/javascripts/user.js
app/assets/javascripts/welcome.js

index 99bfede7e0b88ed292a7c45e722debc8fa1f01fb..e07830d4ea7c7a010ffe5426732298997c5249aa 100644 (file)
@@ -84,7 +84,7 @@ window.updateLinks = function (loc, zoom, layers, object) {
     .toggleClass("disabled", editDisabled);
 };
 
     .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;
   // 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;
index 18c3e38e0776d85228ce73af56dbc5ee6a16fe61..3c294825374c79b675b243fcf090a9c1b502e276 100644 (file)
@@ -1,4 +1,4 @@
-$(document).ready(function () {
+$(function () {
   // Attach referer to authentication buttons
   $(".auth_button").each(function () {
     const params = new URLSearchParams(this.search);
   // Attach referer to authentication buttons
   $(".auth_button").each(function () {
     const params = new URLSearchParams(this.search);
index e55d0900d0b13a9e7d6081a6998043fa74784aeb..a87eb35f18664ad1ac61248024c7fa57937109da 100644 (file)
@@ -1,4 +1,4 @@
-$(document).ready(function () {
+$(function () {
   let marker, map;
 
   function setLocation(e) {
   let marker, map;
 
   function setLocation(e) {
index c53d5e382a1422b3f3b01b5f5857d7cd8f9dd700..7d13dcfbba518b25a21ceb3afc1846e3c738d223 100644 (file)
@@ -1,4 +1,4 @@
-$(document).ready(function () {
+$(function () {
   const id = $("#id-embed"),
         idData = id.data();
 
   const id = $("#id-embed"),
         idData = id.data();
 
index 2b3101db4bdab0fc90f587735b288a0d53c1539c..46afb0f6896a80807e59ee8841c56640f7299bbd 100644 (file)
@@ -1,4 +1,4 @@
-$(document).ready(function () {
+$(function () {
   const params = OSM.params();
 
   let url = "/note/new";
   const params = OSM.params();
 
   let url = "/note/new";
index 9888b3a7e5fc0abaefb76c141e289e1ce297f390..c5bddbaec058a714d2f01ded486cee431a3a1955 100644 (file)
@@ -24,7 +24,7 @@
 //= require index/home
 //= require router
 
 //= require index/home
 //= require router
 
-$(document).ready(function () {
+$(function () {
   const map = new L.OSM.Map("map", {
     zoomControl: false,
     layerControl: false,
   const map = new L.OSM.Map("map", {
     zoomControl: false,
     layerControl: false,
index 078792821e69954c337bca8f220ec9212f5ef626..8297944f3720ff769043899715adcd655d765b80 100644 (file)
@@ -1,4 +1,4 @@
-$(document).ready(function () {
+$(function () {
   // Preserve location hash in referer
   if (location.hash) {
     $("#referer").val($("#referer").val() + location.hash);
   // Preserve location hash in referer
   if (location.hash) {
     $("#referer").val($("#referer").val() + location.hash);
index 2c9968b08097ab7afd34266bdca38bef13be0941..239cf12807c04cfce356dac5b91c7ca07f953006 100644 (file)
@@ -1,5 +1,5 @@
 if (OSM.MATOMO) {
 if (OSM.MATOMO) {
-  $(document).ready(function () {
+  $(function () {
     const base = location.protocol + "//" + OSM.MATOMO.location + "/";
     let matomoTracker;
 
     const base = location.protocol + "//" + OSM.MATOMO.location + "/";
     let matomoTracker;
 
index 0f5933eba5425582ecc516affc7d92e775cbd480..bd6e921b6f44571f08fe8bf1db885a1580883dee 100644 (file)
@@ -1,4 +1,4 @@
-$(document).ready(function () {
+$(function () {
   $(".messages-table .destroy-message").on("turbo:submit-end", function (event) {
     if (event.detail.success) {
       event.target.dataset.isDestroyed = true;
   $(".messages-table .destroy-message").on("turbo:submit-end", function (event) {
     if (event.detail.success) {
       event.target.dataset.isDestroyed = true;
index b118c1d3b7f1e9ad302ce97a893fa4a172b581a0..1731945217731acbea478c10e94e1f10345fd43c 100644 (file)
@@ -1,4 +1,4 @@
-$(document).ready(function () {
+$(function () {
   function openShareUrl(url, initialWidth = 640, initialHeight = 480) {
     const width = Math.max(100, Math.min(screen.width, initialWidth));
     const height = Math.max(100, Math.min(screen.height, initialHeight));
   function openShareUrl(url, initialWidth = 640, initialHeight = 480) {
     const width = Math.max(100, Math.min(screen.width, initialWidth));
     const height = Math.max(100, Math.min(screen.height, initialHeight));
index 9d225a85979c1266c699c76ffe17a303cc503fe3..f3fe02e0c55ac714435ca5b04046385e44b2da29 100644 (file)
@@ -6,7 +6,7 @@
   });
 }());
 
   });
 }());
 
-$(document).ready(function () {
+$(function () {
   const defaultHomeZoom = 12;
   let map, marker, deleted_lat, deleted_lon;
 
   const defaultHomeZoom = 12;
   let map, marker, deleted_lat, deleted_lon;
 
index 41d45bbf8ee9a40a212e94116c9bd32ebdd6a77f..aa94ca295e941720c483fbe6bbb65ac95675821f 100644 (file)
@@ -1,4 +1,4 @@
-$(document).ready(function () {
+$(function () {
   const params = OSM.params();
 
   if (params.lat && params.lon) {
   const params = OSM.params();
 
   if (params.lat && params.lon) {