From 6d0958845bf5309799f8b6a630dc7222ddf089fb Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 19 Oct 2017 13:36:26 +0200 Subject: [PATCH] Fixed inserting of elements failed with adjacent text nodes --- wcfsetup/install/files/js/WoltLabSuite/Core/Dom/Util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Dom/Util.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Dom/Util.js index dca394be39..ac598da69a 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Dom/Util.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Dom/Util.js @@ -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); -- 2.20.1