Fix focus deprecation warning

This commit is contained in:
Senén Rodero Rodríguez
2020-06-23 15:53:58 +02:00
parent e138bbb04e
commit f4916a981a
2 changed files with 2 additions and 2 deletions

View File

@@ -109,7 +109,7 @@
}); });
if ($("[data-legislation-open-phase]").data("legislation-open-phase") !== false) { if ($("[data-legislation-open-phase]").data("legislation-open-phase") !== false) {
App.LegislationAnnotatable.highlight("#7fff9a"); App.LegislationAnnotatable.highlight("#7fff9a");
$("#comments-box textarea").focus(); $("#comments-box textarea").trigger("focus");
$("#new_legislation_annotation").on("ajax:complete", function(e, data) { $("#new_legislation_annotation").on("ajax:complete", function(e, data) {
if (data.status === 200) { if (data.status === 200) {
App.LegislationAnnotatable.remove_highlight(); App.LegislationAnnotatable.remove_highlight();

View File

@@ -1,5 +1,5 @@
<% if comment.errors.any? %> <% if comment.errors.any? %>
$("#comments-box-<%= @annotation.id %> a.publish-comment").hide(); $("#comments-box-<%= @annotation.id %> a.publish-comment").hide();
$("#js-comment-form-annotation-<%= annotation.id %>").toggle(); $("#js-comment-form-annotation-<%= annotation.id %>").toggle();
$("#js-comment-form-annotation-<%= annotation.id %> textarea").focus(); $("#js-comment-form-annotation-<%= annotation.id %> textarea").trigger("focus");
<% end %> <% end %>