From: Alexander Ebert Date: Mon, 13 Oct 2014 13:30:40 +0000 (+0200) Subject: Fixed cursor position when inserting a BBCode X-Git-Tag: 2.1.0_Alpha_1~237 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=60aa66424880ad8f65a4a00a22828a6fc8767291;p=GitHub%2FWoltLab%2FWCF.git Fixed cursor position when inserting a BBCode --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbutton.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbutton.js index 6347648d35..15f8a98389 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbutton.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbutton.js @@ -139,7 +139,8 @@ RedactorPlugins.wbutton = function() { } } else { - this.insert.html('[' + $bbcode + ']' + $selectedHtml + '[/' + $bbcode + ']'); + this.insert.html('[' + $bbcode + ']' + $selectedHtml + this.selection.getMarkerAsHtml() + '[/' + $bbcode + ']', false); + this.selection.restore(); } }