`const` trips the requirejs compiler
authorAlexander Ebert <ebert@woltlab.com>
Mon, 21 Dec 2020 13:53:34 +0000 (14:53 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 21 Dec 2020 13:53:34 +0000 (14:53 +0100)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabSmiley.js

index dd14d4e514fd29e829e2b4ec6df7e41b83897988..d24ac697d2db752b770e154c862e2e44a734dfb8 100644 (file)
@@ -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);