Simplify JavaScript to toggle investment selection
We don't need to replace the whole row, since the changes only affect the button. Therefore, we don't need to depend on an `inserted` event to decide which columns to render in that row.
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
$("#<%= dom_id(@investment) %>").replaceWith(
|
||||
"<%= j render Admin::BudgetInvestments::RowComponent.new(@investment) %>"
|
||||
).trigger("inserted");
|
||||
$("#<%= dom_id(@investment) %> [data-field='selected']").html(
|
||||
"<%= j render(Admin::BudgetInvestments::ToggleSelectionComponent.new(@investment)) %>"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user