mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
More robust editor -> preview position syncing
This commit is contained in:
parent
48a68378ba
commit
d893799106
Binary file not shown.
@ -56,10 +56,7 @@ class PreviewIntegration
|
|||||||
for node in document.querySelectorAll('[data-lnum="' + lnum + '"]')
|
for node in document.querySelectorAll('[data-lnum="' + lnum + '"]')
|
||||||
if is_hidden(node)
|
if is_hidden(node)
|
||||||
continue
|
continue
|
||||||
top = window.calibre_utils.abstop(node) - (window.innerHeight / 2)
|
node.scrollIntoView()
|
||||||
if top < 0
|
|
||||||
top = 0
|
|
||||||
window.scrollTo(0, top)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
line_numbers: () =>
|
line_numbers: () =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user