From: Alexander Ebert Date: Sat, 7 Feb 2015 17:37:28 +0000 (+0100) Subject: Fix for weird paste bug on iOS Safari X-Git-Tag: 2.1.0_RC_1~60 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=09073e050f306c1bfffb50b98b4d7f514ab4d3c5;p=GitHub%2FWoltLab%2FWCF.git Fix for weird paste bug on iOS Safari --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index 89d12fbb05..29bfc4fe7a 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -1031,6 +1031,20 @@ RedactorPlugins.wmonkeypatch = function() { * - fixes text pasting in Internet Explorer 11 (#2040) */ paste: function() { + // paste.createPasteBox + var $mpCreatePasteBox = this.paste.createPasteBox; + this.paste.createPasteBox = (function() { + if ($.browser.iOS) { + this.$pasteBox = $('
').html('').attr('contenteditable', 'true').css({ position: 'absolute', visibility: 'hidden' }); + + this.$box.parent().append(this.$pasteBox); + this.$pasteBox.focus(); + } + else { + $mpCreatePasteBox.call(this); + } + }).bind(this); + // paste.insert var $mpInsert = this.paste.insert; this.paste.insert = (function(html) {