mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
Fixed no md editor preview in FireFox
This commit is contained in:
parent
712ea21efe
commit
e9d42a2e8c
@ -18,21 +18,18 @@ class MarkdownEditor {
|
|||||||
this.markdown.use(mdTasksLists, {label: true});
|
this.markdown.use(mdTasksLists, {label: true});
|
||||||
|
|
||||||
this.display = this.elem.querySelector('.markdown-display');
|
this.display = this.elem.querySelector('.markdown-display');
|
||||||
this.displayDoc = this.display.contentDocument;
|
|
||||||
this.displayStylesLoaded = false;
|
this.displayStylesLoaded = false;
|
||||||
this.input = this.elem.querySelector('textarea');
|
this.input = this.elem.querySelector('textarea');
|
||||||
this.htmlInput = this.elem.querySelector('input[name=html]');
|
this.htmlInput = this.elem.querySelector('input[name=html]');
|
||||||
this.cm = code.markdownEditor(this.input);
|
this.cm = code.markdownEditor(this.input);
|
||||||
|
|
||||||
this.onMarkdownScroll = this.onMarkdownScroll.bind(this);
|
this.onMarkdownScroll = this.onMarkdownScroll.bind(this);
|
||||||
this.init();
|
|
||||||
|
|
||||||
// Scroll to text if needed.
|
this.display.addEventListener('load', () => {
|
||||||
const queryParams = (new URL(window.location)).searchParams;
|
this.displayDoc = this.display.contentDocument;
|
||||||
const scrollText = queryParams.get('content-text');
|
this.init();
|
||||||
if (scrollText) {
|
});
|
||||||
this.scrollToText(scrollText);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
@ -94,6 +91,13 @@ class MarkdownEditor {
|
|||||||
|
|
||||||
this.codeMirrorSetup();
|
this.codeMirrorSetup();
|
||||||
this.listenForBookStackEditorEvents();
|
this.listenForBookStackEditorEvents();
|
||||||
|
|
||||||
|
// Scroll to text if needed.
|
||||||
|
const queryParams = (new URL(window.location)).searchParams;
|
||||||
|
const scrollText = queryParams.get('content-text');
|
||||||
|
if (scrollText) {
|
||||||
|
this.scrollToText(scrollText);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the input content and render the display.
|
// Update the input content and render the display.
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
<div class="editor-toolbar">
|
<div class="editor-toolbar">
|
||||||
<div class="editor-toolbar-label">{{ trans('entities.pages_md_preview') }}</div>
|
<div class="editor-toolbar-label">{{ trans('entities.pages_md_preview') }}</div>
|
||||||
</div>
|
</div>
|
||||||
<iframe class="markdown-display" sandbox="allow-same-origin"></iframe>
|
<iframe srcdoc="" class="markdown-display" sandbox="allow-same-origin"></iframe>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="html"/>
|
<input type="hidden" name="html"/>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user