|
@@ -1,5 +1,3 @@
|
|
|
-import { isTruthy } from 'src/util';
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* interface for htmx configRequest event
|
|
* interface for htmx configRequest event
|
|
|
*/
|
|
*/
|
|
@@ -17,15 +15,6 @@ function initMarkdownPreview(markdownWidget: HTMLDivElement) {
|
|
|
const textarea = markdownWidget.querySelector('textarea') as HTMLTextAreaElement;
|
|
const textarea = markdownWidget.querySelector('textarea') as HTMLTextAreaElement;
|
|
|
const preview = markdownWidget.querySelector('div.preview') as HTMLDivElement;
|
|
const preview = markdownWidget.querySelector('div.preview') as HTMLDivElement;
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * Make sure the textarea has style attribute height
|
|
|
|
|
- * So that it can be copied over to preview div.
|
|
|
|
|
- */
|
|
|
|
|
- if (!isTruthy(textarea.style.height)) {
|
|
|
|
|
- const { height } = textarea.getBoundingClientRect();
|
|
|
|
|
- textarea.style.height = `${height}px`;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* Add the value of the textarea to the body of the htmx request
|
|
* Add the value of the textarea to the body of the htmx request
|
|
|
* and copy the height of text are to the preview div
|
|
* and copy the height of text are to the preview div
|