From: Jan Szejko Date: Thu, 23 Feb 2017 17:02:58 +0000 (+0100) Subject: small fix for lists X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/af57fe565c8a5d6fc36ea5c3dc83065f69534b04?ds=sidebyside small fix for lists (cherry picked from commit a3899fd) --- diff --git a/src/editor/modules/documentCanvas/canvas/keyboard.js b/src/editor/modules/documentCanvas/canvas/keyboard.js index 4136e18..becb355 100644 --- a/src/editor/modules/documentCanvas/canvas/keyboard.js +++ b/src/editor/modules/documentCanvas/canvas/keyboard.js @@ -364,8 +364,10 @@ var keyEventHandlers = [ applies: function(e, s) { var parent = s.element && s.element.wlxmlNode.parent(), parentIsItem = parent && parent.is('item'), - itemIsOnList = parent && parent.parent() && parent.parent().is('list'); - return s.type === 'caret' && e.key === KEYS.ENTER && s.element.isEmpty() && parentIsItem && itemIsOnList; + itemIsOnList = parent && parent.parent() && parent.parent().is('list'), + onlyChild = parent.contents().length === 1; + return s.type === 'caret' && e.key === KEYS.ENTER && s.element.isEmpty() && onlyChild && + parentIsItem && itemIsOnList; }, run: function(e, s) { var item = s.element.wlxmlNode.parent(),