mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
fda1184662
commit
74de46c3f6
@ -38,7 +38,15 @@ class PagePosition(object):
|
||||
if cfi:
|
||||
cfi = json.dumps(cfi)
|
||||
self.document.mainFrame().evaluateJavaScript('''
|
||||
window.cfi.scroll_to(%s);
|
||||
function fix_scroll() {
|
||||
/* cfi.scroll_to() uses scrollIntoView() which can result
|
||||
in scrolling to scrolling along the x-axis. So we
|
||||
explicitly scroll to x=0.
|
||||
*/
|
||||
scrollTo(0, window.pageYOffset)
|
||||
}
|
||||
|
||||
window.cfi.scroll_to(%s, fix_scroll);
|
||||
'''%cfi)
|
||||
|
||||
@property
|
||||
|
Loading…
x
Reference in New Issue
Block a user