Fixed inserting quote with selected non-text elements
authorAlexander Ebert <ebert@woltlab.com>
Sun, 26 Apr 2015 15:53:16 +0000 (17:53 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 26 Apr 2015 15:53:16 +0000 (17:53 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index e6f930857f59ea2ac17379347ac96ea9719e448d..e9a5ec7459ffc2c52013ec23653bc26f196a8c5d 100644 (file)
@@ -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