From 86e326887c92bd5975907685164bfed3a53521df Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 24 May 2018 12:39:08 +0200 Subject: [PATCH] Caret placement for raw bbcodes was incorrect --- .../files/js/3rdParty/redactor2/plugins/WoltLabInsert.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabInsert.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabInsert.js index 8882b76120..50e31529bb 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabInsert.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabInsert.js @@ -78,7 +78,7 @@ $.Redactor.prototype.WoltLabInsert = function() { this.selection.saveInstant(); }).bind(this); - this.placeHtml = (function(html) { + this.insert.placeHtml = (function(html) { var hasBbcodeMarker = false; html.forEach(function(fragment) { if (fragment instanceof Element && fragment.classList.contains('woltlab-bbcode-marker')) { @@ -91,8 +91,10 @@ $.Redactor.prototype.WoltLabInsert = function() { marker = this.insert.node(marker); $(marker).before(html); - this.selection.restore(); - if (!hasBbcodeMarker) this.caret.after(marker); + if (!hasBbcodeMarker) { + this.selection.restore(); + this.caret.after(marker); + } $(marker).remove(); }).bind(this); } -- 2.20.1