Skip to content

Commit

Permalink
Only init multi year chars js view in new
Browse files Browse the repository at this point in the history
  • Loading branch information
noracato committed Jul 9, 2024
1 parent 1a0a59f commit 8b60b41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 0 additions & 4 deletions app/assets/javascripts/multi_year_charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,5 @@
}
});

$(function () {
new MultiYearChartNewView({ el: document.querySelector('#new-collection') }).render();
});

window.MultiYearChartNewView = MultiYearChartNewView;
})(window);
2 changes: 2 additions & 0 deletions app/views/multi_year_charts/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
collection: current_user.saved_scenarios.order(updated_at: :desc).map {|ss| ["<span>#{ss.title}</span>".html_safe, ss.id]}
= f.submit t('multi_year_charts.create'), class: 'save button scenario-button'

:javascript
new MultiYearChartNewView({ el: $('#new-collection') }).render()

0 comments on commit 8b60b41

Please sign in to comment.