From: Alexander Ebert Date: Sun, 26 Apr 2015 15:53:16 +0000 (+0200) Subject: Fixed inserting quote with selected non-text elements X-Git-Tag: 2.1.4~44^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e6231e0f57e2d692637b52ddf41bcc73f6808530;p=GitHub%2FWoltLab%2FWCF.git Fixed inserting quote with selected non-text elements --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index e6f930857f..e9a5ec7459 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -2106,7 +2106,7 @@ RedactorPlugins.wbbcode = function() { } } - var $originalRange = window.getSelection().getRangeAt(0).cloneRange(); + window.getSelection().getRangeAt(0).deleteContents(); this.wutil.restoreSelection(); var $selection = window.getSelection().getRangeAt(0); @@ -2128,8 +2128,6 @@ RedactorPlugins.wbbcode = function() { this.insert.html($html, false); - $originalRange.deleteContents(); - $quote = this.$editor.find('#' + $id); if ($quote.length) { // quote may be empty if $innerHTML was empty, fix it