From a67a4ab43c8e5d07cf21d1a5e4c1726ce486aeba Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 20 Jun 2015 15:16:21 +0200 Subject: [PATCH] Fixed backspace at quote start --- .../js/3rdParty/redactor/plugins/wbbcode.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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; -- 2.20.1