1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Updated editor usability on mobile

This commit is contained in:
Dan Brown
2019-04-13 18:30:11 +01:00
parent 8d358e4894
commit 21e1123d12
5 changed files with 55 additions and 19 deletions

View File

@ -517,6 +517,16 @@ class WysiwygEditor {
if (scrollId) {
scrollToText(scrollId);
}
// Override for touch events to allow scroll on mobile
const container = editor.getContainer();
const toolbarButtons = container.querySelectorAll('.mce-btn');
for (let button of toolbarButtons) {
button.addEventListener('touchstart', event => {
event.stopPropagation();
});
}
window.editor = editor;
});
function editorChange() {
@ -600,6 +610,7 @@ class WysiwygEditor {
// Paste image-uploads
editor.on('paste', event => editorPaste(event, editor, context));
}
};
}