From 21d7e882ae95c95d483d82a0d6ec8a99e72dd06e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 5 Sep 2016 15:15:13 +0200 Subject: [PATCH] Fixed setting caret before/after tables --- .../js/3rdParty/redactor2/plugins/WoltLabCaret.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 -- 2.20.1