From 7f9b0a3d62267e88793b8957a7abd39f50737d82 Mon Sep 17 00:00:00 2001
From: Lene Wasskog <lene.wasskog@nibio.no>
Date: Tue, 29 Oct 2024 14:25:11 +0100
Subject: [PATCH] fix: Make sure grid weather data is initially checked

---
 .../templates/cerealblotchmodels/barleynetblotchform.html     | 4 +++-
 .../cerealblotchmodels/septoriahumiditymodelform.html         | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/cerealblotchmodels/templates/cerealblotchmodels/barleynetblotchform.html b/cerealblotchmodels/templates/cerealblotchmodels/barleynetblotchform.html
index 2eb3820b..a347a492 100755
--- a/cerealblotchmodels/templates/cerealblotchmodels/barleynetblotchform.html
+++ b/cerealblotchmodels/templates/cerealblotchmodels/barleynetblotchform.html
@@ -320,7 +320,7 @@
 		document.getElementById('input-coordinates').style.display="none";
 	}
 
-	window.displayCoordinatesInput = (id) => {
+	window.displayCoordinatesInput = () => {
 		document.getElementById("grid").checked = true;
 		document.getElementById('input-weatherstation').style.display="none";
 		document.getElementById('input-coordinates').style.display="block";
@@ -620,6 +620,8 @@
 				} else {
 					displayCoordinatesInput();
 				}
+			} else {
+				displayCoordinatesInput();
 			}
 		}).catch(function(error) {
         	console.error("Error initializing data:", error);
diff --git a/cerealblotchmodels/templates/cerealblotchmodels/septoriahumiditymodelform.html b/cerealblotchmodels/templates/cerealblotchmodels/septoriahumiditymodelform.html
index 7c41bfeb..559b50c9 100644
--- a/cerealblotchmodels/templates/cerealblotchmodels/septoriahumiditymodelform.html
+++ b/cerealblotchmodels/templates/cerealblotchmodels/septoriahumiditymodelform.html
@@ -405,6 +405,7 @@
 				}
 				else
 				{
+					displayCoordinatesInput();
 					updateGSDates();
 				}
 			});
-- 
GitLab