mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -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
|
# document (body) co-ordinate system
|
||||||
doc = doc or window.document
|
doc = doc or window.document
|
||||||
topdoc = window.document
|
topdoc = window.document
|
||||||
while doc is not topdoc:
|
while doc is not topdoc and doc.defaultView:
|
||||||
# We are in a frame
|
# We are in a frame
|
||||||
frame = doc.defaultView.frameElement
|
frame = doc.defaultView.frameElement
|
||||||
rect = frame.getBoundingClientRect()
|
rect = frame.getBoundingClientRect()
|
||||||
x += rect.left
|
x += rect.left
|
||||||
y += rect.top
|
y += rect.top
|
||||||
doc = frame.ownerDocument
|
doc = frame.ownerDocument
|
||||||
win = doc.defaultView
|
win = doc.defaultView or window
|
||||||
wx, wy = win.pageXOffset, win.pageYOffset
|
wx, wy = win.pageXOffset, win.pageYOffset
|
||||||
x += wx
|
x += wx
|
||||||
y += wy
|
y += wy
|
||||||
|
Loading…
x
Reference in New Issue
Block a user