diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2024-04-29 19:15:16 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2024-04-29 19:15:16 +0000 |
commit | 64a0182b9cff4df2457062056e447aaffe648477 (patch) | |
tree | 982d5bb302f2ff0ea3909a67cc42bd392f4c4673 | |
parent | 4a7e5aff286c1b0f482130a28a229713c4746be4 (diff) | |
download | redmine-64a0182b9cff4df2457062056e447aaffe648477.tar.gz redmine-64a0182b9cff4df2457062056e447aaffe648477.zip |
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
-rw-r--r-- | app/views/journals/edit.js.erb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/views/journals/edit.js.erb b/app/views/journals/edit.js.erb index 96cf6b4f8..73631840f 100644 --- a/app/views/journals/edit.js.erb +++ b/app/views/journals/edit.js.erb @@ -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); + } +})(); |