Fixed paste handling
authorAlexander Ebert <ebert@woltlab.com>
Fri, 20 Jan 2017 10:08:55 +0000 (11:08 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 20 Jan 2017 10:14:03 +0000 (11:14 +0100)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabPaste.js

index 3117a675c113ca8d91a4b4dfc447839d363cf149..2038df8e0b9db8fdb15716d79bf9d3d61ea26124 100644 (file)
@@ -125,10 +125,7 @@ $.Redactor.prototype.WoltLabPaste = function() {
                        this.paste.insert = (function(html, data) {
                                if (isKbd) data.pre = true;
                                
-                               if (data.pre) {
-                                       return mpInsert.call(this, html, data);
-                               }
-                               else if (this.utils.isCurrentOrParent('kbd')) {
+                               if (this.utils.isCurrentOrParent('kbd')) {
                                        mpInsert.call(this, html, data);
                                        
                                        var current = this.selection.current();
@@ -159,6 +156,9 @@ $.Redactor.prototype.WoltLabPaste = function() {
                                        
                                        return;
                                }
+                               else if (data.pre) {
+                                       return mpInsert.call(this, html, data);
+                               }
                                
                                var div = elCreate('div');
                                div.innerHTML = html;