You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2021/06/18 19:38:19 UTC
[airavata-django-portal] 02/20: AIRAVATA-3453 Initialize radio
button inputs with value
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch airavata-3453
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
commit 12470989c5b8bc7850eec1c7ce6739119d0e239c
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Tue Apr 27 10:34:02 2021 -0400
AIRAVATA-3453 Initialize radio button inputs with value
---
.../workspace/templates/django_airavata_workspace/supcrtbl2.html | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/django_airavata/apps/workspace/templates/django_airavata_workspace/supcrtbl2.html b/django_airavata/apps/workspace/templates/django_airavata_workspace/supcrtbl2.html
index 588fc3b..de5d017 100644
--- a/django_airavata/apps/workspace/templates/django_airavata_workspace/supcrtbl2.html
+++ b/django_airavata/apps/workspace/templates/django_airavata_workspace/supcrtbl2.html
@@ -57,12 +57,16 @@ document.getElementById("experiment-editor").addEventListener('loaded', e => {
const radios = document.querySelectorAll(`[name="input:${input.name}"]`);
for (const radio of radios) {
if (radio.value === input.value) {
- radio.checked = true;
+ // Have to set value with setAttribute so it is part of the DOM
+ // since the slot content doesn't appear to get added to the custom
+ // element until later. Setting as a property doesn't work.
+ radio.setAttribute("checked", "checked");
break;
}
}
+ } else if (inputEl.type === 'text') {
+ inputEl.setAttribute("value", input.value);
}
- inputEl.setAttribute("value", input.value);
}
// document.getElementById("myinput").setAttribute("value", input.value);
}