Skip to content

Commit

Permalink
Merge pull request #8036 from cfpb/fix/dd-graph-alignment
Browse files Browse the repository at this point in the history
Align graph line properly and only update graph when visiting step 2
  • Loading branch information
wpears authored Dec 4, 2023
2 parents 71e77ad + 28d43fe commit 719d850
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@ const financialView = {
// financialView.$aboutThisTool.focus();
// }
// );
metricView.updateGraphs(values);
window.location.hash = '#info-right';

analyticsSendEvent({
Expand Down Expand Up @@ -883,6 +882,9 @@ const financialView = {
// Show Step 2
financialView.$evaluateSection.show();
financialView.$bigQuestion.show();

const values = getFinancial.values();
metricView.updateGraphs(values);
// $('html, body')
// .stop()
// .animate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const metricView = {
init: function () {
this.settlementStatus = getSchool.values().settlementSchool || false;
this.setMetrics(this.metrics);
this.updateGraphs();
this.updateDebtBurden();
},

Expand Down Expand Up @@ -196,7 +195,7 @@ const metricView = {
const min = $graph.attr('data-graph-min');
const max = $graph.attr('data-graph-max');
const $school = $graph.find('.bar-graph_point__you');
const $national = $graph.find('bar-graph_point__average');
const $national = $graph.find('.bar-graph_point__average');
const bottoms = {};
const bottomOffset = 20;

Expand All @@ -214,10 +213,10 @@ const metricView = {
$graph.addClass('bar-graph__high-point');
}
$school.each((elem) => {
elem.style.bottom = bottoms.school;
elem.style.bottom = bottoms.school + 'px';
});
$national.each((elem) => {
elem.style.bottom = bottoms.national;
elem.style.bottom = bottoms.national + 'px';
});
},

Expand Down

0 comments on commit 719d850

Please sign in to comment.