Fixed cursor position when inserting a BBCode
authorAlexander Ebert <ebert@woltlab.com>
Mon, 13 Oct 2014 13:30:40 +0000 (15:30 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 13 Oct 2014 13:30:40 +0000 (15:30 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbutton.js

index 6347648d35696efa8c8a24780d66ace211442e78..15f8a98389f60a543d9f3aa3e6f41fe9cf624954 100644 (file)
@@ -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();
                                }
                        }