From: Alexander Ebert Date: Sat, 13 Dec 2014 16:50:08 +0000 (+0100) Subject: Fixed pasting in Internet Explorer 11 X-Git-Tag: 2.1.0_Beta_1~35 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=408dd5a6d60627b26849aa4c4a232d9990bafbef;p=GitHub%2FWoltLab%2FWCF.git Fixed pasting in Internet Explorer 11 --- 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); },