]> source.dussan.org Git - redmine.git/commitdiff
Merged r22791 from trunk to 5.0-stable (#40556).
authorMarius Balteanu <marius.balteanu@zitec.com>
Mon, 29 Apr 2024 19:15:45 +0000 (19:15 +0000)
committerMarius Balteanu <marius.balteanu@zitec.com>
Mon, 29 Apr 2024 19:15:45 +0000 (19:15 +0000)
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@22797 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/journals/edit.js.erb

index 96cf6b4f80ed5f633a1d36c4f0f4abb61307705d..73631840f4d511dc298d61034c8bc3318aa83a75 100644 (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);
+  }
+})();