mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit book: When syncing the position of the preview panel to the cursor
in the editor and the cursor is at or before the <body> tag set the position of the preview panel to the top of the file, so that the top margin of the body tag is seen easily.
This commit is contained in:
parent
4bd730cca6
commit
30deb207e4
Binary file not shown.
@ -56,7 +56,10 @@ class PreviewIntegration
|
||||
for node in document.querySelectorAll('[data-lnum="' + lnum + '"]')
|
||||
if is_hidden(node)
|
||||
continue
|
||||
node.scrollIntoView()
|
||||
if node is document.body
|
||||
window.scrollTo(0, 0)
|
||||
else
|
||||
node.scrollIntoView()
|
||||
return
|
||||
|
||||
line_numbers: () =>
|
||||
|
Loading…
x
Reference in New Issue
Block a user