1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-16 03:06:27 +00:00

Specified MarkdownPreview class

This commit is contained in:
roottool
2019-01-27 22:26:31 +09:00
parent 1683d63f33
commit 5e87ec2627

View File

@@ -833,9 +833,9 @@ export default class MarkdownPreview extends React.Component {
} }
) )
document.querySelectorAll('iframe').forEach(item => { const markdownPreviewIframe = document.querySelector('.MarkdownPreview')
const rect = item.getBoundingClientRect() const rect = markdownPreviewIframe.getBoundingClientRect()
const imgList = item.contentWindow.document.body.querySelectorAll('img') const imgList = markdownPreviewIframe.contentWindow.document.body.querySelectorAll('img')
for (const img of imgList) { for (const img of imgList) {
img.onclick = () => { img.onclick = () => {
const widthMagnification = document.body.clientWidth / img.width const widthMagnification = document.body.clientWidth / img.width
@@ -907,7 +907,6 @@ export default class MarkdownPreview extends React.Component {
document.body.appendChild(overlay) document.body.appendChild(overlay)
} }
} }
})
} }
focus () { focus () {