From e6231e0f57e2d692637b52ddf41bcc73f6808530 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 26 Apr 2015 17:53:16 +0200 Subject: [PATCH] Fixed inserting quote with selected non-text elements --- .../install/files/js/3rdParty/redactor/plugins/wbbcode.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 -- 2.20.1