From 7940010d07ab124b0cbfe3044d98a4bb00edba25 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 21 Dec 2020 14:53:34 +0100 Subject: [PATCH] `const` trips the requirejs compiler --- .../files/js/3rdParty/redactor2/plugins/WoltLabSmiley.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabSmiley.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabSmiley.js index dd14d4e514..d24ac697d2 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabSmiley.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabSmiley.js @@ -31,22 +31,22 @@ $.Redactor.prototype.WoltLabSmiley = function() { // Check if there is a zero-width whitespace after the smiley, Safari does // not like them that much (caret will be placed inside a character). - const nextSibling = smiley.nextSibling; + var nextSibling = smiley.nextSibling; if (nextSibling && nextSibling.nodeType === Node.TEXT_NODE && nextSibling.textContent === "\u200B") { nextSibling.remove(); } smiley.parentNode.insertBefore(document.createTextNode(" "), smiley); - const whitespace = document.createTextNode(" "); + var whitespace = document.createTextNode(" "); smiley.parentNode.insertBefore(whitespace, smiley.nextSibling); // Replace the image with itself to forcefully invalidate any references. //noinspection SillyAssignmentJS smiley.outerHTML = smiley.outerHTML; - const selection = window.getSelection(); - const range = document.createRange(); + var selection = window.getSelection(); + var range = document.createRange(); range.selectNode(whitespace); range.collapse(false); -- 2.20.1