mirror of
https://github.com/status-im/codimd.git
synced 2025-01-11 23:14:24 +00:00
refactor: fix lint warning on public/js/syncscroll.js
Signed-off-by: BoHong Li <a60814billy@gmail.com>
This commit is contained in:
parent
e564c40b4d
commit
45ba0c646d
@ -188,7 +188,7 @@ function buildMapInner (callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nonEmptyList.push(0)
|
nonEmptyList.push(0)
|
||||||
// make the first line go top
|
// make the first line go top
|
||||||
_scrollMap[0] = viewTop
|
_scrollMap[0] = viewTop
|
||||||
|
|
||||||
const parts = markdownArea.find('.part').toArray()
|
const parts = markdownArea.find('.part').toArray()
|
||||||
@ -336,7 +336,7 @@ export function syncScrollToView (event, preventAnimate) {
|
|||||||
const scrollInfo = editor.getScrollInfo()
|
const scrollInfo = editor.getScrollInfo()
|
||||||
const textHeight = editor.defaultTextHeight()
|
const textHeight = editor.defaultTextHeight()
|
||||||
lineNo = Math.floor(scrollInfo.top / textHeight)
|
lineNo = Math.floor(scrollInfo.top / textHeight)
|
||||||
// if reach the last line, will start lerp to the bottom
|
// if reach the last line, will start lerp to the bottom
|
||||||
const diffToBottom = (scrollInfo.top + scrollInfo.clientHeight) - (scrollInfo.height - textHeight)
|
const diffToBottom = (scrollInfo.top + scrollInfo.clientHeight) - (scrollInfo.height - textHeight)
|
||||||
if (scrollInfo.height > scrollInfo.clientHeight && diffToBottom > 0) {
|
if (scrollInfo.height > scrollInfo.clientHeight && diffToBottom > 0) {
|
||||||
topDiffPercent = diffToBottom / textHeight
|
topDiffPercent = diffToBottom / textHeight
|
||||||
|
Loading…
x
Reference in New Issue
Block a user