From: Alexander Ebert Date: Wed, 31 Aug 2016 10:18:16 +0000 (+0200) Subject: Fix Shift+Enter sometimes not moving caret X-Git-Tag: 3.0.0_Beta_1~380 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6c7233b2fd5ffd652f4555f70bafaa7e808b5cf3;p=GitHub%2FWoltLab%2FWCF.git Fix Shift+Enter sometimes not moving caret --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js index 6ec4ffc4ce..05b68f50cb 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js @@ -37,6 +37,16 @@ $.Redactor.prototype.WoltLabKeydown = function() { if (isBlockquote) this.keydown.blockquote = isBlockquote; }).bind(this); + this.keydown.onShiftEnter = (function(e) { + this.buffer.set(); + + if (this.keydown.pre) { + return this.keydown.insertNewLine(e); + } + + return this.insert.raw('
\u200B'); + }).bind(this); + var mpOnTab = this.keydown.onTab; this.keydown.onTab = (function(e, key) { if (!this.keydown.pre && $(this.selection.current()).closest('ul, ol', this.core.editor()[0]).length === 0) {