From 88ad1b309125cc6be81499bed189a24bbcd7debd Mon Sep 17 00:00:00 2001 From: Scott Jehl Date: Fri, 27 Jan 2023 15:35:46 -0500 Subject: [PATCH 1/2] disable dependent fields when their initial check is unchecked This will be helpful in avoiding sending large payloads from populated fields that are not part of an experiment run --- www/experiments.php | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/www/experiments.php b/www/experiments.php index 386e63bcfe..9bb7ea699a 100644 --- a/www/experiments.php +++ b/www/experiments.php @@ -325,7 +325,7 @@ function observationHTML($parts) $out .= <<
- + EOT; $addmore = $exp->addmore ? ' experiment_pair_value-add' : ''; @@ -352,7 +352,7 @@ function observationHTML($parts) $out .= <<
- +
@@ -547,6 +547,35 @@ function UpdateStatus(){ From 3d7a778e638bdd8d65fa982d07630865c2aeae9e Mon Sep 17 00:00:00 2001 From: Scott Jehl Date: Fri, 27 Jan 2023 15:39:48 -0500 Subject: [PATCH 2/2] css to pair with hiding fields that are unchecked --- www/assets/css/pagestyle2.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/assets/css/pagestyle2.css b/www/assets/css/pagestyle2.css index 9e6047ca53..74fa9e1c3b 100644 --- a/www/assets/css/pagestyle2.css +++ b/www/assets/css/pagestyle2.css @@ -1169,6 +1169,11 @@ h4.experiments_list_hed-recs { flex: 1 1 auto; } +/* hide stuff after unchecked dependency checks */ +.has-js .experiment_description_go:not(.experiment_description_go-checked) label:first-child ~ * { + display: none; +} + .experiment_description_go > label.experiment_pair_value input, .experiment_description_go > label.experiment_pair_value textarea { width: 14em;