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.
6 lines
229 B
Plaintext
6 lines
229 B
Plaintext
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();
|