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) {
|
} catch (err) {
|
||||||
newRoot = errorToDOM(err);
|
newRoot = errorToDOM(err);
|
||||||
}
|
}
|
||||||
const parent = oldRoot.parentElement;
|
const parent = oldRoot.parentNode;
|
||||||
if (parent) {
|
if (parent) {
|
||||||
parent.replaceChild(newRoot, oldRoot);
|
parent.replaceChild(newRoot, oldRoot);
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,8 +242,8 @@ class TemplateBuilder {
|
||||||
if (prevValue !== newValue) {
|
if (prevValue !== newValue) {
|
||||||
prevValue = newValue;
|
prevValue = newValue;
|
||||||
const newNode = renderNode(node);
|
const newNode = renderNode(node);
|
||||||
if (node.parentElement) {
|
if (node.parentNode) {
|
||||||
node.parentElement.replaceChild(newNode, node);
|
node.parentNode.replaceChild(newNode, node);
|
||||||
}
|
}
|
||||||
node = newNode;
|
node = newNode;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue