editor: lists fix - do not touch context root on list creation
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 26 Jun 2014 07:37:03 +0000 (09:37 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 14 Aug 2014 14:26:13 +0000 (16:26 +0200)
This stops including context root node into a new list.

src/editor/plugins/core/lists.js

index 7a9d321..c6de730 100644 (file)
@@ -12,6 +12,10 @@ var getBoundriesForAList = function(fragment) {
     }
     if(fragment instanceof fragment.NodeFragment) {
         node = fragment.node.getNearestElementNode();
     }
     if(fragment instanceof fragment.NodeFragment) {
         node = fragment.node.getNearestElementNode();
+        if(node.isContextRoot()) {
+            node = fragment.node;
+        }
+
         return {
             node1: node,
             node2: node
         return {
             node1: node,
             node2: node