From 408dd5a6d60627b26849aa4c4a232d9990bafbef Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 13 Dec 2014 17:50:08 +0100 Subject: [PATCH] Fixed pasting in Internet Explorer 11 --- .../js/3rdParty/redactor/plugins/wmonkeypatch.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index 73d12e75ff..5e149c11d9 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -733,7 +733,8 @@ RedactorPlugins.wmonkeypatch = function() { /** * Partially overwrites the 'paste' module. * - * - prevent screwed up, pasted HTML from placing text nodes (and inline elements) in the editor's direct root + * - prevent screwed up, pasted HTML from placing text nodes (and inline elements) in the editor's direct root + * - fixes text pasting in Internet Explorer 11 (#2040) */ paste: function() { var $fixDOM = (function() { @@ -772,7 +773,15 @@ RedactorPlugins.wmonkeypatch = function() { this.paste.insert = (function(html) { $mpInsert.call(this, html); - setTimeout($fixDOM, 20); + setTimeout((function() { + $fixDOM(); + + if ($.browser.msie) { + getSelection().getRangeAt(0).collapse(true); + } + + this.wutil.saveSelection(); + }).bind(this), 20); }).bind(this); }, -- 2.20.1