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;
// 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;
}
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)