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/a3899fd?ds=inline small fix for lists --- diff --git a/src/editor/modules/documentCanvas/canvas/keyboard.js b/src/editor/modules/documentCanvas/canvas/keyboard.js index 577c2fe..0871199 100644 --- a/src/editor/modules/documentCanvas/canvas/keyboard.js +++ b/src/editor/modules/documentCanvas/canvas/keyboard.js @@ -360,8 +360,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(),