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:23 UTC
[airavata-django-portal] 06/20: AIRAVATA-3453 Initialize textarea
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 815b52493ca2745d329983c2c24bea528e7ef848
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed May 5 09:55:41 2021 -0400
AIRAVATA-3453 Initialize textarea value
---
.../django_airavata_workspace/supcrtbl2.html | 24 ++++++++++++----------
1 file changed, 13 insertions(+), 11 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 14d7a14..fc266a3 100644
--- a/django_airavata/apps/workspace/templates/django_airavata_workspace/supcrtbl2.html
+++ b/django_airavata/apps/workspace/templates/django_airavata_workspace/supcrtbl2.html
@@ -188,19 +188,21 @@ document.getElementById("experiment-editor").addEventListener('loaded', e => {
// console.log("slotEl=", slotEl);
if (slotEl) {
const inputEls = slotEl.querySelectorAll('input');
+ const textareaEl = slotEl.querySelector('textarea');
// console.log("inputEls=", inputEls);
- if (!inputEls || inputEls.length === 0) {
- continue;
- }
- if (inputEls[0].type === 'text') {
- inputEls[0].value = input.value;
- } else if (inputEls[0].type === 'radio') {
- for (radio of inputEls) {
- if (radio.value === input.value) {
- radio.checked = true;
- break;
+ if (inputEls && inputEls.length > 0) {
+ if (inputEls[0].type === 'text') {
+ inputEls[0].value = input.value;
+ } else if (inputEls[0].type === 'radio') {
+ for (radio of inputEls) {
+ if (radio.value === input.value) {
+ radio.checked = true;
+ break;
+ }
}
}
+ } else if (textareaEl) {
+ textareaEl.value = input.value;
}
}
}
@@ -469,7 +471,7 @@ function resetViews() {
alert("Please Fill in All Items");
return false;
}
- if(validOutput){return true;}
+ // if(validOutput){return true;}
return true;
}
</script>