mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-31 11:37:14 +00:00
Focus on the textarea after clicking the Edit Journal button (#40556).
Patch by Yasu Saku (@skys). git-svn-id: https://svn.redmine.org/redmine/trunk@22791 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
b5c48c1d97
commit
f94370962a
@ -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);
|
||||
}
|
||||
})();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user