From c720ac28e6cdd239d4f7bc06d4c465d4daeea17c Mon Sep 17 00:00:00 2001
From: Tor-Einar Skog <tor-einar.skog@nibio.no>
Date: Thu, 9 Jun 2022 14:27:02 +0200
Subject: [PATCH] Changed button logic: If selecting POI, "Back" changes to
 "OK"

---
 src/components/MapObservation.vue | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/components/MapObservation.vue b/src/components/MapObservation.vue
index 1ab3708..6f7605b 100644
--- a/src/components/MapObservation.vue
+++ b/src/components/MapObservation.vue
@@ -44,7 +44,7 @@
 					<router-link id='btnBack'
 						:to="{name: 'Observation', params:{observationId:myObservationId, paramGeoinfo:myGeoInfo, paramObservation:mapObservation}}"
 						class="vips-btn">
-						{{ $t("map.link.back.label") }}
+						<span v-if="wasPoiSelected">{{ $t("map.link.OK.label") }}</span><span v-else>{{ $t("map.link.back.label") }}</span> 
 					</router-link>
 				</div>
 			</div>
@@ -136,6 +136,7 @@
 				myObservationId: '',
 				mapObservation: {},
 				isMapClicked: false,
+				wasPoiSelected: false
 			}
 		},
 		methods: {
@@ -420,6 +421,7 @@
 			},
 
 			selectPOI(event) {
+				this.wasPoiSelected = true;
 				let myPOI = this.poi;
 				if (event.target.value != 0) {
 					$.each(this.lstPOI, function (index, poi) {
-- 
GitLab