From: Alexander Ebert Date: Thu, 24 May 2018 10:39:08 +0000 (+0200) Subject: Caret placement for raw bbcodes was incorrect X-Git-Tag: 3.1.3_pl_1~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=86e326887c92bd5975907685164bfed3a53521df;p=GitHub%2FWoltLab%2FWCF.git Caret placement for raw bbcodes was incorrect --- 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); }