From: Alexander Ebert Date: Sat, 20 Jun 2015 13:16:21 +0000 (+0200) Subject: Fixed backspace at quote start X-Git-Tag: 2.1.5~17^2~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a67a4ab43c8e5d07cf21d1a5e4c1726ce486aeba;p=GitHub%2FWoltLab%2FWCF.git Fixed backspace at quote start --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 63e9cfabf4..7a8239c53f 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -1738,6 +1738,23 @@ RedactorPlugins.wbbcode = function() { if ($isEmpty) { $preventAndSelectQuote = true; } + else { + // check if caret is at the start of the quote + var range = (this.selection.implicitRange === null) ? this.range : this.selection.implicitRange; + if (range.startOffset === 0) { + var element = range.startContainer, prev; + while ((element = element.parentNode) !== null) { + prev = element.previousSibling; + if (prev !== null) { + if (prev.nodeType === Node.ELEMENT_NODE && prev.nodeName === 'HEADER') { + $preventAndSelectQuote = true; + } + + break; + } + } + } + } } else { var $range = (this.selection.implicitRange === null) ? this.range : this.selection.implicitRange;