Fixed inserting of elements failed with adjacent text nodes
authorAlexander Ebert <ebert@woltlab.com>
Thu, 19 Oct 2017 11:36:26 +0000 (13:36 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 19 Oct 2017 11:36:26 +0000 (13:36 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Dom/Util.js

index dca394be39fd82e3ed45f5f8ae7da5eaaacc6535..ac598da69af4ff50ee85bdd8a19b0a504bee7ca4 100644 (file)
@@ -181,8 +181,8 @@ define(['Environment', 'StringUtil'], function(Environment, StringUtil) {
                 * @param       {Element}       el              reference element
                 */
                insertAfter: function(newEl, el) {
-                       if (el.nextElementSibling !== null) {
-                               el.parentNode.insertBefore(newEl, el.nextElementSibling);
+                       if (el.nextSibling !== null) {
+                               el.parentNode.insertBefore(newEl, el.nextSibling);
                        }
                        else {
                                el.parentNode.appendChild(newEl);