1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

improve line anchors placement

This commit is contained in:
Dick Choi
2016-07-26 13:27:59 +09:00
parent 80d16233e7
commit c6eff157de
3 changed files with 12 additions and 15 deletions

View File

@@ -148,7 +148,7 @@ export default class MarkdownPreview extends React.Component {
let row = parseInt(lineAnchor.getAttribute('data-key'))
if (row > targetRow) {
let targetAnchor = lineAnchors[index - 1]
this.getWindow().scrollTo(0, targetAnchor.offsetTop)
targetAnchor != null && this.getWindow().scrollTo(0, targetAnchor.offsetTop)
break
}
}