Skip to content

Commit

Permalink
Align graph line properly and only update graph when visiting step 2
Browse files Browse the repository at this point in the history
  • Loading branch information
wpears committed Nov 29, 2023
1 parent 19fea69 commit 28d43fe
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 @@ -629,7 +629,6 @@ const financialView = {
// financialView.$aboutThisTool.focus();
// }
// );
metricView.updateGraphs(values);
window.location.hash = '#info-right';

analyticsSendEvent({
Expand Down Expand Up @@ -882,6 +881,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 28d43fe

Please sign in to comment.