More robust editor -> preview position syncing

This commit is contained in:
Kovid Goyal 2013-11-23 10:55:33 +05:30
parent 48a68378ba
commit d893799106
2 changed files with 1 additions and 4 deletions

Binary file not shown.

View File

@ -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: () =>