forked from mystiq/hydrogen-web
Use parentNode, parentElement is not supported on IE11
This commit is contained in:
parent
a7acb0278d
commit
a0c8d147c3
2 changed files with 3 additions and 3 deletions
|
@ -47,7 +47,7 @@ export class SwitchView {
|
|||
} catch (err) {
|
||||
newRoot = errorToDOM(err);
|
||||
}
|
||||
const parent = oldRoot.parentElement;
|
||||
const parent = oldRoot.parentNode;
|
||||
if (parent) {
|
||||
parent.replaceChild(newRoot, oldRoot);
|
||||
}
|
||||
|
|
|
@ -242,8 +242,8 @@ class TemplateBuilder {
|
|||
if (prevValue !== newValue) {
|
||||
prevValue = newValue;
|
||||
const newNode = renderNode(node);
|
||||
if (node.parentElement) {
|
||||
node.parentElement.replaceChild(newNode, node);
|
||||
if (node.parentNode) {
|
||||
node.parentNode.replaceChild(newNode, node);
|
||||
}
|
||||
node = newNode;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue