]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/edit/id.js.erb
Add reload on iframe redirect
[rails.git] / app / assets / javascripts / edit / id.js.erb
index b85dbeddbbb4d0d39b4d5f63f3f7b52386548625..b32f6cb011819c7ced3c5bc70d8f7921dd7f5de3 100644 (file)
@@ -4,7 +4,7 @@ $(function () {
 
   if (!idData.configured) {
     // eslint-disable-next-line no-alert
-    alert(I18n.t("site.edit.id_not_configured"));
+    alert(OSM.i18n.t("site.edit.id_not_configured"));
     return;
   }
 
@@ -36,4 +36,10 @@ $(function () {
   if (idData.gpx) params.set("gpx", idData.gpx);
 
   id.attr("src", idData.url + "#" + params);
+
+  id.ready(function () {
+    if (!this.contentWindow.location.href.startsWith(idData.url)) {
+      location.reload();
+    }
+  });
 });