mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
Merge pull request #322 from alex-atomic/patch-1
Update parser.js to check if query is null for IE
This commit is contained in:
commit
c2088a1b3a
1 changed files with 2 additions and 2 deletions
|
@ -269,7 +269,7 @@ EPUBJS.Parser.prototype.spine = function(spineXml, manifest){
|
|||
EPUBJS.Parser.prototype.querySelectorByType = function(html, element, type){
|
||||
var query = html.querySelector(element+'[*|type="'+type+'"]');
|
||||
// Handle IE not supporting namespaced epub:type in querySelector
|
||||
if(query.length === 0) {
|
||||
if(query === null || query.length === 0) {
|
||||
query = html.querySelectorAll(element);
|
||||
for (var i = 0; i < query.length; i++) {
|
||||
if(query[i].getAttributeNS("http://www.idpf.org/2007/ops", "type") === type) {
|
||||
|
@ -458,4 +458,4 @@ EPUBJS.Parser.prototype.pageListItem = function(item, spineIndexByURL, bookSpine
|
|||
"page" : page
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue