1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-14 01:21:51 +03:00

Updated markdown editor for mobile

Also tweaked padding and responsivness on many common elements
This commit is contained in:
Dan Brown
2019-04-14 12:04:20 +01:00
parent 21e1123d12
commit 01be72d5e2
13 changed files with 79 additions and 15 deletions

View File

@ -71,6 +71,19 @@ class MarkdownEditor {
if (action === 'insertDrawing') this.actionStartDrawing();
});
// Mobile section toggling
this.elem.addEventListener('click', event => {
const toolbarLabel = event.target.closest('.editor-toolbar-label');
if (!toolbarLabel) return;
const currentActiveSections = this.elem.querySelectorAll('.markdown-editor-wrap');
for (let activeElem of currentActiveSections) {
activeElem.classList.remove('active');
}
toolbarLabel.closest('.markdown-editor-wrap').classList.add('active');
});
window.$events.listen('editor-markdown-update', value => {
this.cm.setValue(value);
this.updateAndRender();