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:
@ -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();
|
||||
|
Reference in New Issue
Block a user