0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-18 14:21:05 +00:00

Added auto-focus behaviour to page editor

- Will focus on title if the value of the field matches the default text
for the current user's language.
- Otherwise will focus on the editor body.
- Added and tested on both editors.

For 
This commit is contained in:
Dan Brown 2020-04-27 15:54:39 +01:00
parent 8ce38d2158
commit 4ef362143b
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
4 changed files with 32 additions and 6 deletions
resources/js/components

View file

@ -557,6 +557,11 @@ class MarkdownEditor {
const prependLineCount = markdown.split('\n').length;
this.cm.setCursor(cursorPos.line + prependLineCount, cursorPos.ch);
});
// Focus on editor
window.$events.listen('editor::focus', () => {
this.cm.focus();
});
}
}