From: Alexander Ebert Date: Mon, 5 Feb 2018 16:37:34 +0000 (+0100) Subject: Outdenting nested list caused the list item to escape the editor X-Git-Tag: 3.1.0_RC_3~5^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=abac12df488dd0a9878df1a37a5d1109042c8e95;p=GitHub%2FWoltLab%2FWCF.git Outdenting nested list caused the list item to escape the editor See #2529 --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabIndent.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabIndent.js index b1da114841..5c60142e62 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabIndent.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabIndent.js @@ -102,6 +102,24 @@ $.Redactor.prototype.WoltLabIndent = function() { }).bind(this); } + this.indent.repositionItem = (function($item) { + var $next = $item.next(); + if ($next.length !== 0 && ($next[0].tagName !== 'UL' || $next[0].tagName !== 'OL')) { + $item.append($next); + } + + var $prev = $item.prev(); + if ($prev.length !== 0 && $prev[0].tagName !== 'LI') { + this.selection.save(); + // WoltLab modification + //var $li = $item.parents('li', this.core.editor()[0]); + var $li = $item.closest('li', this.core.editor()[0]); + // WoltLab modification END + $li.after($item); + this.selection.restore(); + } + }).bind(this); + this.indent.normalize = (function() { // `document.execCommand('outdent')` can spawn a `
` if there is whitespace in the DOM // see https://bugzilla.mozilla.org/show_bug.cgi?id=1428073