Skip to content

Commit 719d850

Browse files
authored
Merge pull request #8036 from cfpb/fix/dd-graph-alignment
Align graph line properly and only update graph when visiting step 2
2 parents 71e77ad + 28d43fe commit 719d850

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

cfgov/unprocessed/apps/paying-for-college/js/disclosures/views/financial-view.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,6 @@ const financialView = {
630630
// financialView.$aboutThisTool.focus();
631631
// }
632632
// );
633-
metricView.updateGraphs(values);
634633
window.location.hash = '#info-right';
635634

636635
analyticsSendEvent({
@@ -883,6 +882,9 @@ const financialView = {
883882
// Show Step 2
884883
financialView.$evaluateSection.show();
885884
financialView.$bigQuestion.show();
885+
886+
const values = getFinancial.values();
887+
metricView.updateGraphs(values);
886888
// $('html, body')
887889
// .stop()
888890
// .animate(

cfgov/unprocessed/apps/paying-for-college/js/disclosures/views/metric-view.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ const metricView = {
4242
init: function () {
4343
this.settlementStatus = getSchool.values().settlementSchool || false;
4444
this.setMetrics(this.metrics);
45-
this.updateGraphs();
4645
this.updateDebtBurden();
4746
},
4847

@@ -196,7 +195,7 @@ const metricView = {
196195
const min = $graph.attr('data-graph-min');
197196
const max = $graph.attr('data-graph-max');
198197
const $school = $graph.find('.bar-graph_point__you');
199-
const $national = $graph.find('bar-graph_point__average');
198+
const $national = $graph.find('.bar-graph_point__average');
200199
const bottoms = {};
201200
const bottomOffset = 20;
202201

@@ -214,10 +213,10 @@ const metricView = {
214213
$graph.addClass('bar-graph__high-point');
215214
}
216215
$school.each((elem) => {
217-
elem.style.bottom = bottoms.school;
216+
elem.style.bottom = bottoms.school + 'px';
218217
});
219218
$national.each((elem) => {
220-
elem.style.bottom = bottoms.national;
219+
elem.style.bottom = bottoms.national + 'px';
221220
});
222221
},
223222

0 commit comments

Comments
 (0)