From: Alexander Ebert Date: Mon, 5 Sep 2016 13:15:13 +0000 (+0200) Subject: Fixed setting caret before/after tables X-Git-Tag: 3.0.0_Beta_1~299 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=21d7e882ae95c95d483d82a0d6ec8a99e72dd06e;p=GitHub%2FWoltLab%2FWCF.git Fixed setting caret before/after tables --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js index 6b00feb703..7077de0e0a 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js @@ -146,7 +146,18 @@ $.Redactor.prototype.WoltLabCaret = function() { var block = this.selection.block(); if (block === false) { - return; + // check if the caret is now in a

before a + // which also happens to be the last element + if (this.selection.current() === this.$editor[0]) { + var node = this.$editor[0].childNodes[this.selection.get().anchorOffset]; + if (node.nodeType === Node.ELEMENT_NODE && node.nodeName === 'TABLE') { + block = node; + } + } + + if (block === false) { + return; + } } // get block element that received the click