Caret was incorrectly placed when hitting the padding of a block element
authorAlexander Ebert <ebert@woltlab.com>
Fri, 6 Oct 2017 10:19:47 +0000 (12:19 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 6 Oct 2017 10:19:47 +0000 (12:19 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js

index e7451f28f6ff7ffe611db2cf56209dc58bb0c37d..b77aebc6aadbb3a934d7fdd7b2c3e19dba244538 100644 (file)
@@ -288,6 +288,11 @@ $.Redactor.prototype.WoltLabCaret = function() {
                                }
                        }
                        
+                       // click occured inside the boundaries of the block
+                       if (insertBefore === undefined) {
+                               return;
+                       }
+                       
                        // check if there is already a paragraph in place
                        var sibling = block[(insertBefore ? 'previous' : 'next') + 'ElementSibling'];
                        if (sibling && sibling.nodeName === 'P') {