From: Alexander Ebert Date: Mon, 11 Sep 2017 14:28:00 +0000 (+0200) Subject: Fixed pasting of content with a trailing link X-Git-Tag: 3.1.0_Alpha_4~14^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f47392c8a81f7323f1c6a7493f2b1d891f81bac8;p=GitHub%2FWoltLab%2FWCF.git Fixed pasting of content with a trailing link --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabPaste.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabPaste.js index 0a27bd4518..f0de39ad39 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabPaste.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabPaste.js @@ -204,28 +204,14 @@ $.Redactor.prototype.WoltLabPaste = function() { }).bind(this)); } - // fix selection marker - /* - elBySelAll('.redactor-selection-marker', div, elRemove); - div.appendChild(elCreate('woltlab-selection-marker')); - */ - mpInsert.call(this, div.innerHTML, data); - /* - var marker = elBySel('woltlab-selection-marker', this.$editor[0]); - if (marker) { - var range = document.createRange(); - range.setStartBefore(marker); - range.setEndBefore(marker); - - var selection = window.getSelection(); - selection.removeAllRanges(); - selection.addRange(range); - - elRemove(marker); + // check if the caret is now inside an element, but at + // the very last position + var selection = window.getSelection(); + if (selection.rangeCount && selection.anchorNode.nodeName === 'A' && selection.anchorOffset === selection.anchorNode.childNodes.length) { + this.caret.after(selection.anchorNode); } - */ if (pastedImages.length) { window.setTimeout((function () {