mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-05-27 09:12:34 -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:
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: () =>
|
||||
|
||||
Reference in New Issue
Block a user