Skip to content

Commit

Permalink
OpenWrite解锁文章高度调整
Browse files Browse the repository at this point in the history
  • Loading branch information
tangly1024 committed Sep 6, 2024
1 parent b0d6865 commit 498e8d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/OpenWrite.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ const OpenWrite = () => {
// btw初始化后,开始监听read-more-wrap何时消失
const intervalId = setInterval(() => {
const readMoreWrapElement = document.getElementById('read-more-wrap')
const articleWrapElement = document.getElementById('article-wrapper')

if (!readMoreWrapElement) {
if (!readMoreWrapElement && articleWrapElement) {
toggleTocItems(false) // 恢复目录项的点击
// 自动调整文章区域的高度
articleWrapElement.style.height = 'auto'
// 停止定时器
clearInterval(intervalId)
}
Expand Down

0 comments on commit 498e8d0

Please sign in to comment.