Skip to content

Commit

Permalink
Restore Stacked selection on Charts
Browse files Browse the repository at this point in the history
In 08cc679, 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.
  • Loading branch information
cbrandtbuffalo committed Dec 4, 2024
1 parent aa31c37 commit 5b6b12e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions share/html/Search/Chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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},
Expand All @@ -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},
Expand All @@ -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},
Expand All @@ -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},
Expand Down Expand Up @@ -356,13 +356,13 @@ <h5 class="titlebox-inner-heading mt-2 ml-2">X-Axis</h5>
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());
}
});

Expand Down

0 comments on commit 5b6b12e

Please sign in to comment.