mirror of
https://github.com/status-im/codimd.git
synced 2025-02-10 14:36:36 +00:00
Fix body scrolling in published page
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
This commit is contained in:
parent
62bbf928b7
commit
4219985658
@ -24,6 +24,7 @@ function findOrCreateLightboxContainer () {
|
|||||||
const hideContainer = (e) => {
|
const hideContainer = (e) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
lightBoxContainer.classList.remove('show')
|
lightBoxContainer.classList.remove('show')
|
||||||
|
document.body.classList.remove('no-scroll')
|
||||||
}
|
}
|
||||||
|
|
||||||
lightBoxContainer.querySelector('.lightbox-control-previous').addEventListener('click', (e) => {
|
lightBoxContainer.querySelector('.lightbox-control-previous').addEventListener('click', (e) => {
|
||||||
@ -71,6 +72,7 @@ function onClickImage (img) {
|
|||||||
setImageInner(img, lightBoxContainer)
|
setImageInner(img, lightBoxContainer)
|
||||||
|
|
||||||
lightBoxContainer.classList.add('show')
|
lightBoxContainer.classList.add('show')
|
||||||
|
document.body.classList.add('no-scroll')
|
||||||
|
|
||||||
currentImage = img
|
currentImage = img
|
||||||
updateLightboxImages()
|
updateLightboxImages()
|
||||||
|
@ -62,3 +62,7 @@
|
|||||||
.markdown-body img.md-image {
|
.markdown-body img.md-image {
|
||||||
cursor: zoom-in;
|
cursor: zoom-in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.no-scroll {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user