Fixes #721. Firefox insertAdjacentHTML updating text nodes with "beforeend" instead of creating new ones.
This commit is contained in:
parent
a9ab36388b
commit
9a42242454
1 changed files with 6 additions and 1 deletions
|
|
@ -636,7 +636,12 @@ var m = (function app(window, undefined) {
|
||||||
}
|
}
|
||||||
else nextSibling.insertAdjacentHTML("beforebegin", data);
|
else nextSibling.insertAdjacentHTML("beforebegin", data);
|
||||||
}
|
}
|
||||||
else parentElement.insertAdjacentHTML("beforeend", data);
|
else {
|
||||||
|
if (window.Range && window.Range.prototype.createContextualFragment) {
|
||||||
|
parentElement.appendChild($document.createRange().createContextualFragment(data));
|
||||||
|
}
|
||||||
|
else parentElement.insertAdjacentHTML("beforeend", data);
|
||||||
|
}
|
||||||
var nodes = [];
|
var nodes = [];
|
||||||
while (parentElement.childNodes[index] !== nextSibling) {
|
while (parentElement.childNodes[index] !== nextSibling) {
|
||||||
nodes.push(parentElement.childNodes[index]);
|
nodes.push(parentElement.childNodes[index]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue