1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

Support nav item with muliple properties, fixes #124

This commit is contained in:
fchasen 2014-12-04 23:24:51 -05:00
parent e9ebec3f64
commit eca5ffbeff
9 changed files with 21 additions and 13 deletions

File diff suppressed because one or more lines are too long

View file

@ -5352,12 +5352,14 @@ EPUBJS.Parser.prototype.packageContents = function(packageXml, baseUrl){
//-- Find TOC NAV
EPUBJS.Parser.prototype.findNavPath = function(manifestNode){
var node = manifestNode.querySelector("item[properties^='nav']");
// Find item with property 'nav'
// Should catch nav irregardless of order
var node = manifestNode.querySelector("item[properties$='nav'], item[properties^='nav '], item[properties*=' nav ']");
return node ? node.getAttribute('href') : false;
};
//-- Find TOC NCX: media-type="application/x-dtbncx+xml" href="toc.ncx"
EPUBJS.Parser.prototype.findTocPath = function(manifestNode){
EPUBJS.Parser.prototype.findTocPath = function(manifestNode, spineNode){
var node = manifestNode.querySelector("item[media-type='application/x-dtbncx+xml']");
var tocId;