Update UI if pathway mode is set to build
Some checks failed
CI / test (pull_request) Failing after 17s
API CI / api-tests (pull_request) Failing after 27s

This commit is contained in:
Tim Lorsbach
2026-06-09 10:24:00 +02:00
parent 8ed3b506cc
commit 520fb9f510

View File

@ -105,7 +105,7 @@
></iframe> ></iframe>
</div> </div>
<label class="select mb-8 w-full"> <label class="select mb-8 w-full" id="prediction-setting-label">
<span class="label">Predictor</span> <span class="label">Predictor</span>
<select id="prediction-setting" name="prediction-setting"> <select id="prediction-setting" name="prediction-setting">
<option disabled>Select a Setting</option> <option disabled>Select a Setting</option>
@ -148,6 +148,22 @@
</div> </div>
{# prettier-ignore-start #} {# prettier-ignore-start #}
<script> <script>
// Hide predictor selection and update button text if mode is "build"
function radioChange(event) {
if (event.target.value === "build") {
document.getElementById("prediction-setting-label").hidden = true;
document.getElementById("predict-submit-button").innerText = "Build";
} else {
document.getElementById("prediction-setting-label").hidden = false;
document.getElementById("predict-submit-button").innerText = "Predict";
}
}
const radioButtons = document.querySelectorAll('input[name="predict"]');
radioButtons.forEach(radio => {
radio.addEventListener('change', radioChange);
});
// Helper function to safely get Ketcher instance from iframe // Helper function to safely get Ketcher instance from iframe
function getKetcherInstance(iframeId) { function getKetcherInstance(iframeId) {
const ketcherFrame = document.getElementById(iframeId); const ketcherFrame = document.getElementById(iframeId);