Skip to content

Commit 38759ce

Browse files
committed
use iframe variable
1 parent 6f50323 commit 38759ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web_src/js/markup/mermaid.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ export async function renderMermaid() {
4848
iframe.classList.add('markup-render');
4949
iframe.sandbox = 'allow-scripts allow-same-origin';
5050
iframe.srcdoc = `<html><head><style>${iframeCss}</style></head><body>${svg}</body></html>`;
51-
iframe.addEventListener('load', (e) => {
52-
const height = e.target.contentWindow.document.body.clientHeight;
51+
iframe.addEventListener('load', () => {
52+
const height = iframe.contentWindow.document.body.clientHeight;
5353
iframe.style.height = `${height}px`;
5454
});
5555

0 commit comments

Comments
 (0)