mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
Fix webkit hash target, add annotation events
This commit is contained in:
parent
186c4fa395
commit
56722c7726
3 changed files with 22 additions and 11 deletions
|
@ -617,9 +617,15 @@ class Contents {
|
|||
|
||||
let id = target.substring(target.indexOf("#")+1);
|
||||
let el = this.document.getElementById(id);
|
||||
|
||||
if(el) {
|
||||
position = el.getBoundingClientRect();
|
||||
if (isWebkit) {
|
||||
// Webkit reports incorrect bounding rects in Columns
|
||||
let newRange = new Range();
|
||||
newRange.selectNode(el);
|
||||
position = newRange.getBoundingClientRect();
|
||||
} else {
|
||||
position = el.getBoundingClientRect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue