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

Connected md editor settings to logic for functionality

This commit is contained in:
Dan Brown
2022-11-28 12:12:36 +00:00
parent 9fd5190c70
commit ec3713bc74
10 changed files with 99 additions and 28 deletions

View File

@ -17,6 +17,14 @@ export class Display {
} else {
this.container.addEventListener('load', this.onLoad.bind(this));
}
this.updateVisibility(editor.settings.get('showPreview'));
editor.settings.onChange('showPreview', show => this.updateVisibility(show));
}
updateVisibility(show) {
const wrap = this.container.closest('.markdown-editor-wrap');
wrap.style.display = show ? null : 'none';
}
onLoad() {