mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
New queue flush, handle cfi for display, re-display on resize
This commit is contained in:
parent
42efc34517
commit
ac926479cf
12 changed files with 941 additions and 399 deletions
|
@ -188,7 +188,7 @@ EPUBJS.Map.prototype.findTextEndRange = function(node, start, end){
|
|||
|
||||
pos = range.getBoundingClientRect();
|
||||
|
||||
if(pos.left > end) {
|
||||
if(pos.left > end && prev) {
|
||||
return prev;
|
||||
} else if(pos.right > end) {
|
||||
return range;
|
||||
|
@ -215,7 +215,7 @@ EPUBJS.Map.prototype.splitTextNodeIntoRanges = function(node, _splitter){
|
|||
|
||||
pos = text.indexOf(splitter);
|
||||
|
||||
if(pos === -1) {
|
||||
if(pos === -1 || node.nodeType != Node.TEXT_NODE) {
|
||||
range = doc.createRange();
|
||||
range.selectNodeContents(node);
|
||||
return [range];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue