Merged r22791 from trunk to 5.1-stable (#40556).

git-svn-id: https://svn.redmine.org/redmine/branches/5.1-stable@22796 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2024-04-29 19:15:16 +00:00
parent 4a7e5aff28
commit 64a0182b9c

View File

@@ -6,3 +6,13 @@ if ($("form#journal-<%= @journal.id %>-form").length > 0) {
} else {
$("#journal-<%= @journal.id %>-notes").after('<%= escape_javascript(render :partial => 'notes_form') %>');
}
// Focus on the textarea
(() => {
const textarea = $("#journal-<%= @journal.id %>-form .wiki-edit");
if (textarea.length > 0) {
textarea.focus();
const textareaLength = textarea.val().length;
textarea.get(0).setSelectionRange(textareaLength, textareaLength);
}
})();