[FIX] web: IE <= 11.0 doesn't support ChildNode.remove

IE 11.0 doesn't support `Childnode.remove`:
http://caniuse.com/#feat=childnode-remove

As a workaround, we use `Node.removeChild`,
which is more widely supported.

opw-710617
This commit is contained in:
Denis Ledoux
2017-03-06 18:21:06 +01:00
parent 6458210250
commit cde8668034
+2 -1
View File
@@ -327,7 +327,8 @@ QWeb2.Engine = (function() {
if (self.tools.trim(text_node.nodeValue)) {
return self.tools.exception("Error: text is not allowed between branching directives");
}
text_node.remove();
// IE <= 11.0 doesn't support ChildNode.remove
text_node.parentNode.removeChild(text_node);
}
} else {
return self.tools.exception("Error: t-elif and t-else directives must be preceded by a t-if or t-elif directive");