From 924e64c9922948cdf9af63496cba817e120d996a Mon Sep 17 00:00:00 2001 From: Lene Wasskog <lene.wasskog@nibio.no> Date: Wed, 23 Oct 2024 10:46:49 +0200 Subject: [PATCH] feat: Adjust button labels according to map type --- src/main/webapp/js/mapModal.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/js/mapModal.js b/src/main/webapp/js/mapModal.js index 425e3c8b..91ca63f9 100644 --- a/src/main/webapp/js/mapModal.js +++ b/src/main/webapp/js/mapModal.js @@ -35,6 +35,7 @@ class MapModal { static TRANSLATIONS = { nb: { selectLocation: 'Velg sted', + selectCoordinates: 'Velg punkt', createNewLocation: 'Opprett nytt sted', name: 'Navn', latitude: 'Breddegrad', @@ -54,6 +55,7 @@ class MapModal { }, en: { selectLocation: 'Select location', + selectCoordinates: 'Select point', createNewLocation: 'Create New Location', name: 'Name', latitude: 'Latitude', @@ -394,7 +396,7 @@ class MapModal { const type = this.translations['poiType' + feature.properties.pointOfInterestTypeId]; const latitude = feature.geometry.coordinates[1].toFixed(this.coordinatePrecision); const longitude = feature.geometry.coordinates[0].toFixed(this.coordinatePrecision); - const buttonLabel = this.translations.selectLocation; + const buttonLabel = this.isPoiMap ? this.translations.selectLocation : this.translations.selectCoordinates; if(this.isPoiMap) { popupElement.innerHTML = `<h4>${name}</h4> @@ -470,7 +472,7 @@ class MapModal { </select> </div> <div class="form-group text-right"> - <button id="map-poi-submit-button" class="btn btn-primary">${this.translations.selectLocation}</button> + <button id="map-poi-submit-button" class="btn btn-primary">${this.isPoiMap ? this.translations.selectLocation : this.translations.selectCoordinates}</button> </div> </div>`; -- GitLab