From: Alexander Ebert Date: Mon, 22 Aug 2016 10:51:37 +0000 (+0200) Subject: Added tab key support X-Git-Tag: 3.0.0_Beta_1~593 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=68d07486dd819f1147625456ab63f77c23d27e49;p=GitHub%2FWoltLab%2FWCF.git Added tab key support --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js index af89fcfcf9..5313e6d057 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js @@ -36,6 +36,15 @@ $.Redactor.prototype.WoltLabKeydown = function() { if (isBlockquote) this.keydown.blockquote = isBlockquote; }).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) { + return true; + } + + return mpOnTab.call(this, e, key); + }).bind(this); }, register: function (tag) {