From 6c7233b2fd5ffd652f4555f70bafaa7e808b5cf3 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 31 Aug 2016 12:18:16 +0200 Subject: [PATCH] Fix Shift+Enter sometimes not moving caret --- .../js/3rdParty/redactor2/plugins/WoltLabKeydown.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) { -- 2.20.1