mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-16 03:06:27 +00:00
Specified MarkdownPreview class
This commit is contained in:
@@ -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 () {
|
||||||
|
|||||||
Reference in New Issue
Block a user