DocumentFragment.children is not supported in IE
authorAlexander Ebert <ebert@woltlab.com>
Wed, 7 Sep 2016 11:35:08 +0000 (13:35 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 7 Sep 2016 11:35:08 +0000 (13:35 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js

index 8a57c8168756de729a09f1a6ae18eb88670b505f..7cfb8ecc7f3743136cb2d0a36c182b7e9964c0e4 100644 (file)
@@ -311,7 +311,16 @@ define(
                                        DomUtil.setInnerHtml(content, html);
                                }
                                else if (html instanceof DocumentFragment) {
-                                       if (html.children[0].nodeName !== 'div' || html.childElementCount > 1) {
+                                       var children = [], node;
+                                       for (var i = 0, length = html.childNodes.length; i < length; i++) {
+                                               node = html.childNodes[i];
+                                               
+                                               if (node.nodeType === Node.ELEMENT_NODE) {
+                                                       children.push(node);
+                                               }
+                                       }
+                                       
+                                       if (children[0].nodeName !== 'div' || children.length > 1) {
                                                content = elCreate('div');
                                                content.id = id;
                                                content.appendChild(html);