mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-24 07:39:59 +08:00
Adds edit icon to each header in the page.
Towards #618 Signed-off-by: Abijeet <abijeetpatro@gmail.com>
This commit is contained in:
@ -497,6 +497,19 @@ class WysiwygEditor {
|
||||
editorChange(html);
|
||||
});
|
||||
|
||||
window.$events.listen('editor-scroll-to-text', textId => {
|
||||
const element = editor.dom.get(textId)
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
// scroll the element into the view and put the cursor at the end.
|
||||
element.scrollIntoView();
|
||||
editor.selection.select(element, true);
|
||||
editor.selection.collapse(false);
|
||||
editor.focus();
|
||||
});
|
||||
|
||||
registerEditorShortcuts(editor);
|
||||
|
||||
let wrap;
|
||||
|
Reference in New Issue
Block a user