Focus on the textarea after clicking the Edit Journal button - like with issues https://www.redmine.org/issues/40556
This commit is contained in:
parent
6367b3d8d1
commit
26db5aba63
@ -6,3 +6,13 @@ if ($("form#journal-<%= @journal.id %>-form").length > 0) {
|
|||||||
} else {
|
} else {
|
||||||
$("#journal-<%= @journal.id %>-notes").after("<%= escape_javascript(render 'notes_form') %>");
|
$("#journal-<%= @journal.id %>-notes").after("<%= escape_javascript(render '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);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
Loading…
Reference in New Issue
Block a user