Fixed footnotes in IE11. Fixes #573
This commit is contained in:
parent
59f5044232
commit
2d2cedd174
@ -104,10 +104,14 @@ define([
|
||||
}
|
||||
|
||||
var footnoteMap = {};
|
||||
var footnoteFragment = document.createDocumentFragment();
|
||||
// Store one footnote elt in the footnote map
|
||||
function storeFootnote(footnoteElt) {
|
||||
var id = footnoteElt.id.substring(3);
|
||||
var oldFootnote = footnoteMap[id];
|
||||
oldFootnote && footnoteFragment.removeChild(oldFootnote);
|
||||
footnoteMap[id] = footnoteElt;
|
||||
footnoteFragment.appendChild(footnoteElt);
|
||||
}
|
||||
|
||||
var footnoteContainerElt;
|
||||
@ -179,7 +183,12 @@ define([
|
||||
}, crel('hr'), footnoteElts));
|
||||
}
|
||||
// Keep used footnotes only in our map
|
||||
footnoteMap = _.pick(footnoteMap, usedFootnoteIds);
|
||||
Object.keys(footnoteMap).forEach(function(key) {
|
||||
if(usedFootnoteIds.indexOf(key) === -1) {
|
||||
footnoteFragment.removeChild(footnoteMap[key]);
|
||||
delete footnoteMap[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user