1
0
Fork 0
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:
Fred Chasen 2015-11-19 12:47:28 -05:00
commit c2088a1b3a

View file

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