From 60aa66424880ad8f65a4a00a22828a6fc8767291 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 13 Oct 2014 15:30:40 +0200 Subject: [PATCH] Fixed cursor position when inserting a BBCode --- wcfsetup/install/files/js/3rdParty/redactor/plugins/wbutton.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(); } } -- 2.20.1