mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-05 15:32:55 +02:00
fixed epub cfi segment ids
This commit is contained in:
parent
81dcc5bc44
commit
d4ffdead7f
5 changed files with 18 additions and 12 deletions
|
@ -598,7 +598,7 @@ EPUBJS.Book.prototype.nextPage = function(){
|
|||
var next;
|
||||
|
||||
if(!this.isRendered) return this._enqueue("nextPage", arguments);
|
||||
|
||||
|
||||
next = this.render.nextPage();
|
||||
|
||||
if(!next){
|
||||
|
@ -1246,14 +1246,17 @@ EPUBJS.EpubCFI.prototype.generateFragment = function(element, chapter) {
|
|||
if(chapter) parts.push(chapter);
|
||||
|
||||
path.forEach(function(part){
|
||||
parts.push((part.index + 1) * 2);
|
||||
var segment = '';
|
||||
segment += (part.index + 1) * 2;
|
||||
|
||||
if(part.id &&
|
||||
part.id.slice(0, 6) != "EPUBJS") { //-- ignore internal @EPUBJS ids
|
||||
|
||||
parts.push("[" + part.id + "]");
|
||||
|
||||
segment += "[" + part.id + "]";
|
||||
|
||||
}
|
||||
|
||||
|
||||
parts.push(segment);
|
||||
});
|
||||
|
||||
return parts.join('/');
|
||||
|
|
2
build/epub.min.js
vendored
2
build/epub.min.js
vendored
File diff suppressed because one or more lines are too long
2
demo/js/epub.min.js
vendored
2
demo/js/epub.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -533,7 +533,7 @@ EPUBJS.Book.prototype.nextPage = function(){
|
|||
var next;
|
||||
|
||||
if(!this.isRendered) return this._enqueue("nextPage", arguments);
|
||||
|
||||
|
||||
next = this.render.nextPage();
|
||||
|
||||
if(!next){
|
||||
|
|
|
@ -26,14 +26,17 @@ EPUBJS.EpubCFI.prototype.generateFragment = function(element, chapter) {
|
|||
if(chapter) parts.push(chapter);
|
||||
|
||||
path.forEach(function(part){
|
||||
parts.push((part.index + 1) * 2);
|
||||
var segment = '';
|
||||
segment += (part.index + 1) * 2;
|
||||
|
||||
if(part.id &&
|
||||
part.id.slice(0, 6) != "EPUBJS") { //-- ignore internal @EPUBJS ids
|
||||
|
||||
parts.push("[" + part.id + "]");
|
||||
|
||||
segment += "[" + part.id + "]";
|
||||
|
||||
}
|
||||
|
||||
|
||||
parts.push(segment);
|
||||
});
|
||||
|
||||
return parts.join('/');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue