We were rendering the whole sidebar again, which wasn't necessary since most of it remains unchanged. This resulted in complicated code to pass the necessary information to render the same map that was already rendered. Furthermore, when users had been moving the map around or zooming out, we were resetting the map to its default settings after voting, which was potentially annoying. This also fixes the wrong investments being displayed in the map after voting; only the investments on the current page were displayed in this case while the index displayed all of them.
14 lines
455 B
Plaintext
14 lines
455 B
Plaintext
$("#progress_bar").html("<%= j render("budgets/ballot/progress_bar", ballot: @ballot, heading: @heading) %>");
|
|
$("#my_ballot").html("<%= j render(
|
|
Budgets::Investments::MyBallotComponent.new(
|
|
ballot: @ballot,
|
|
heading: @heading,
|
|
investment_ids: @investment_ids
|
|
)
|
|
) %>");
|
|
$("#ballot").html("<%= j render("budgets/ballot/ballot") %>")
|
|
|
|
<%= render "refresh_ballots",
|
|
investment_ids: @investment_ids,
|
|
ballot: @ballot %>
|