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