1
0
Fork 0
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:
Fred Chasen 2018-12-05 15:56:47 -08:00
parent 186c4fa395
commit 56722c7726
3 changed files with 22 additions and 11 deletions

View file

@ -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();
}
}
}