this.markdown.use(mdTasksLists, {label: true});
this.display = this.elem.querySelector('.markdown-display');
this.markdown.use(mdTasksLists, {label: true});
this.display = this.elem.querySelector('.markdown-display');
this.displayStylesLoaded = false;
this.input = this.elem.querySelector('textarea');
this.htmlInput = this.elem.querySelector('input[name=html]');
this.cm = code.markdownEditor(this.input);
this.onMarkdownScroll = this.onMarkdownScroll.bind(this);
this.displayStylesLoaded = false;
this.input = this.elem.querySelector('textarea');
this.htmlInput = this.elem.querySelector('input[name=html]');
this.cm = code.markdownEditor(this.input);
this.onMarkdownScroll = this.onMarkdownScroll.bind(this);
- // Scroll to text if needed.
- const queryParams = (new URL(window.location)).searchParams;
- const scrollText = queryParams.get('content-text');
- if (scrollText) {
- this.scrollToText(scrollText);
- }
+ this.display.addEventListener('load', () => {
+ this.displayDoc = this.display.contentDocument;
+ this.init();
+ });