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 #2036
This commit is contained in:
Dan Brown
2020-04-27 15:54:39 +01:00
parent 8ce38d2158
commit 4ef362143b
4 changed files with 32 additions and 6 deletions

View File

@ -402,6 +402,10 @@ function listenForBookStackEditorEvents(editor) {
editor.setContent(content);
});
// Focus on the editor
window.$events.listen('editor::focus', () => {
editor.focus();
});
}
class WysiwygEditor {