From ece2b0d93bb38460d5c3e85283cbf8d557157bd7 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 30 Jul 2025 18:55:21 +0100 Subject: [PATCH] Move showAlert function out of download utilities --- app/assets/javascripts/download_util.js | 7 ------- app/assets/javascripts/osm.js.erb | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/download_util.js b/app/assets/javascripts/download_util.js index d425c421f..0aff1479f 100644 --- a/app/assets/javascripts/download_util.js +++ b/app/assets/javascripts/download_util.js @@ -9,13 +9,6 @@ OSM.downloadBlob = function (blob, filename) { URL.revokeObjectURL(url); }; -OSM.showAlert = function (message) { - const modalBody = document.getElementById("osm_alert_message"); - modalBody.textContent = message; - const alertModal = new bootstrap.Modal(document.getElementById("osm_alert_modal")); - alertModal.show(); -}; - OSM.getTurboBlobHandler = function (filename) { function handleExportSuccess({ fetchResponse }) { fetchResponse.response.blob() diff --git a/app/assets/javascripts/osm.js.erb b/app/assets/javascripts/osm.js.erb index 596381c90..ae462940c 100644 --- a/app/assets/javascripts/osm.js.erb +++ b/app/assets/javascripts/osm.js.erb @@ -217,5 +217,12 @@ OSM = { const zoom = map.getZoom(), center = OSM.cropLocation(map.getCenter(), zoom).reverse(); return [...center, zoom, map.getLayersCode()].join("|"); + }, + + showAlert: function (message) { + const modalBody = document.getElementById("osm_alert_message"); + modalBody.textContent = message; + const alertModal = new bootstrap.Modal(document.getElementById("osm_alert_modal")); + alertModal.show(); } }; -- 2.39.5