mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Fix Edit button in highlights panel not working
I dont know why defaultView is undefined, seems like a chrome bug
This commit is contained in:
parent
8eca4d7ced
commit
265a620bee
@ -79,14 +79,14 @@ class ScrollViewport:
|
||||
# document (body) co-ordinate system
|
||||
doc = doc or window.document
|
||||
topdoc = window.document
|
||||
while doc is not topdoc:
|
||||
while doc is not topdoc and doc.defaultView:
|
||||
# We are in a frame
|
||||
frame = doc.defaultView.frameElement
|
||||
rect = frame.getBoundingClientRect()
|
||||
x += rect.left
|
||||
y += rect.top
|
||||
doc = frame.ownerDocument
|
||||
win = doc.defaultView
|
||||
win = doc.defaultView or window
|
||||
wx, wy = win.pageXOffset, win.pageYOffset
|
||||
x += wx
|
||||
y += wy
|
||||
|
Loading…
x
Reference in New Issue
Block a user