mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2099678 [Clicking on an article in a newsletter scrolls the Table of Contents to the end](https://bugs.launchpad.net/calibre/+bug/2099678)
This commit is contained in:
parent
0d92c9f7dd
commit
c4de6b9bd9
@ -850,7 +850,7 @@ def handle_gesture(gesture):
|
|||||||
|
|
||||||
def get_bounding_client_rect(elem):
|
def get_bounding_client_rect(elem):
|
||||||
br = elem.getBoundingClientRect()
|
br = elem.getBoundingClientRect()
|
||||||
if br.width is 0 and br.height is 0:
|
if br.width is 0 and br.height is 0 and br.x is 0 and br.y is 0:
|
||||||
# getBoundingClientRect() fails sometimes, see https://bugs.launchpad.net/calibre/+bug/2037543
|
# getBoundingClientRect() fails sometimes, see https://bugs.launchpad.net/calibre/+bug/2037543
|
||||||
r = document.createRange()
|
r = document.createRange()
|
||||||
r.selectNodeContents(elem)
|
r.selectNodeContents(elem)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user