]> BookStack Code Mirror - bookstack/blobdiff - resources/js/markdown/display.js
Adjusted/improved some color setting wording
[bookstack] / resources / js / markdown / display.js
index 7e1925431cf284aa460be22abacc995c1cdd10c4..2c78da1899fe75504e4578093ebd684c93c479bd 100644 (file)
@@ -17,6 +17,14 @@ export class Display {
         } else {
             this.container.addEventListener('load', this.onLoad.bind(this));
         }
         } 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() {
     }
 
     onLoad() {