Focus the proposal selection switch after pressing it

Since this button is replaced by a new element in an AJAX call, nothing
was focused after pressing it.

So we're reusing the code we used to enable/disable budget phases, which
already dealt with this issue.
This commit is contained in:
Javi Martín
2024-10-06 13:15:08 +02:00
parent 2acaa14705
commit 02b6302f25
6 changed files with 16 additions and 13 deletions

View File

@@ -0,0 +1,5 @@
var new_toggle_switch = $("<%= j new_content %>");
var current_toggle_switch = $("#<%= dom_id(record) %> .toggle-switch");
current_toggle_switch.replaceWith(new_toggle_switch);
new_toggle_switch.find("[type='submit']").focus();