From 0927cb47957766ecf767162aa6a465a34fe2104e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 10 Jan 2015 17:15:24 +0100 Subject: [PATCH] Fixed delete/backspace handling still relying on the old DOM --- .../install/files/js/3rdParty/redactor/plugins/wbbcode.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 70bfbcd472..c45679054e 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -1429,7 +1429,7 @@ RedactorPlugins.wbbcode = function() { if ($quote.length) { // check if quote is empty var $isEmpty = true; - $quote.find('div > div').each(function() { + $quote.children('div').each(function() { if ($(this).text().replace(/\u200B/, '').length) { $isEmpty = false; return false; @@ -1471,13 +1471,13 @@ RedactorPlugins.wbbcode = function() { // arrow down case $.ui.keyCode.DOWN: if ($current.next('blockquote').length) { - this.caret.setStart($current.next().find('> div > div:first')); + this.caret.setStart($current.next().children('div:first')); data.cancel = true; } else if ($parent) { if ($parent.next('blockquote').length) { - this.caret.setStart($parent.next().find('> div > div:first')); + this.caret.setStart($parent.next().children('div:first')); data.cancel = true; } @@ -1532,7 +1532,7 @@ RedactorPlugins.wbbcode = function() { else { if ($previousElement[0].tagName === 'BLOCKQUOTE') { // set focus to quote text rather than the element itself - this.caret.sendEnd($previousElement.find('> div > div:last')); + this.caret.sendEnd($previousElement.children('div:last')); } else { // focus is wrong if the previous element is empty (e.g. only a newline present) -- 2.20.1