From 5b6b12ed4ed1cb63d2463bdae80054f5ea4b038c Mon Sep 17 00:00:00 2001 From: Jim Brandt Date: Wed, 4 Dec 2024 10:22:00 -0500 Subject: [PATCH] Restore Stacked selection on Charts In 08cc6792bd, we removed the fieldset tags to standardize the group by selections. Some JS on the page triggered based on the fieldset tag, so selecting Stacked charts stopped working after that change. Add a custom class to each group by row and update the JS to restore the Stacked selection. --- share/html/Search/Chart.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/share/html/Search/Chart.html b/share/html/Search/Chart.html index 791bdbd1ea..7238606156 100644 --- a/share/html/Search/Chart.html +++ b/share/html/Search/Chart.html @@ -174,7 +174,7 @@ % } <&| /Widgets/TitleBox, title => loc('Group by'), class => "chart-group-by" &> - <&| /Elements/LabeledValue, Label => loc('Group [_1] by', loc(lc $Class->Table)), &> + <&| /Elements/LabeledValue, Label => loc('Group [_1] by', loc(lc $Class->Table)), Class => 'rt-chart-groupby-row' &> <& Elements/SelectGroupBy, Name => 'GroupBy', Query => $query{Query}, @@ -184,7 +184,7 @@ Class => $Class, &> - <&| /Elements/LabeledValue, Label => loc('and then'), &> + <&| /Elements/LabeledValue, Label => loc('and then'), Class => 'rt-chart-groupby-row' &> <& Elements/SelectGroupBy, Name => 'GroupBy', Query => $query{Query}, @@ -195,7 +195,7 @@ Class => $Class, &> - <&| /Elements/LabeledValue, Label => loc('and then'), &> + <&| /Elements/LabeledValue, Label => loc('and then'), Class => 'rt-chart-groupby-row' &> <& Elements/SelectGroupBy, Name => 'GroupBy', Query => $query{Query}, @@ -206,7 +206,7 @@ Class => $Class, &> - <&| /Elements/LabeledValue, Label => loc('and then'), &> + <&| /Elements/LabeledValue, Label => loc('and then'), Class => 'rt-chart-groupby-row' &> <& Elements/SelectGroupBy, Name => 'GroupBy', Query => $query{Query}, @@ -217,7 +217,7 @@ Class => $Class, &> - <&| /Elements/LabeledValue, Label => loc('and then'), &> + <&| /Elements/LabeledValue, Label => loc('and then'), Class => 'rt-chart-groupby-row' &> <& Elements/SelectGroupBy, Name => 'GroupBy', Query => $query{Query}, @@ -356,13 +356,13 @@
X-Axis
jQuery("select[name=GroupBy]").change( function() { // "GroupBy-Groups" could be triggered because the they are fully cloned from "GroupBy" if ( jQuery(this).attr('name') == 'GroupBy-Groups' ) { - var elem = jQuery(this).closest('fieldset').find('select[name=GroupBy]'); + var elem = jQuery(this).closest('.rt-chart-groupby-row').find('select[name=GroupBy]'); setTimeout( function () { elem.change(); }, 100 ); // give it a moment to prepare "GroupBy" options } else { - jQuery(this).closest('fieldset').find('input.stacked-group-checkbox').val(jQuery(this).val()); + jQuery(this).closest('.rt-chart-groupby-row').find('input.stacked-group-checkbox').val(jQuery(this).val()); } });