From 6e9833300b22e68145858b3ed531501d997eb19c Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 7 Feb 2018 15:34:49 +0100 Subject: [PATCH] IE11 does not expose `DocumentFragment.children` --- .../js/3rdParty/redactor2/plugins/WoltLabDropdown.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabDropdown.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabDropdown.js index b471e674df..009bae4e01 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabDropdown.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabDropdown.js @@ -31,7 +31,15 @@ $.Redactor.prototype.WoltLabDropdown = function() { } } - if (fragment.children.length > 0) { + var hasItems = false; + for (var i = 0, length = fragment.childNodes.length; i < length; i++) { + if (fragment.childNodes[i].nodeType === Node.ELEMENT_NODE) { + hasItems = true; + break; + } + } + + if (hasItems) { $dropdown[0].rel = name; $dropdown[0].appendChild(fragment); } -- 2.20.1