refactoring
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 10 Jul 2013 15:33:21 +0000 (17:33 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 10 Jul 2013 15:33:21 +0000 (17:33 +0200)
modules/documentCanvas/canvas/canvas.js

index e125db5..3eb4c6e 100644 (file)
@@ -198,7 +198,7 @@ $.extend(Canvas.prototype.list, {
         });
 
         var reference = listIsNested ? list.parent() : list;
         });
 
         var reference = listIsNested ? list.parent() : list;
-        if(precedingItems.length === 0 && succeedingItems.length === 0) {
+        if(succeedingItems.length === 0) {
             var list = reference;
             extractedItems.forEach(function(item) {
                 reference.after(item);
             var list = reference;
             extractedItems.forEach(function(item) {
                 reference.after(item);
@@ -206,15 +206,9 @@ $.extend(Canvas.prototype.list, {
                 if(!listIsNested)
                     item.setWlxmlClass(null);
             });
                 if(!listIsNested)
                     item.setWlxmlClass(null);
             });
-            list.detach();
-        } else if(precedingItems.length > 0 && succeedingItems.length === 0) {
-            extractedItems.forEach(function(item) {
-                reference.after(item);
-                reference = item;
-                if(!listIsNested)
-                    item.setWlxmlClass(null);
-            });
-        } else if(precedingItems.length === 0 && succeedingItems.length > 0) {
+            if(precedingItems.length === 0)
+                list.detach();
+        } else if(precedingItems.length === 0) {
             extractedItems.forEach(function(item) {
                 reference.before(item);
                 if(!listIsNested)
             extractedItems.forEach(function(item) {
                 reference.before(item);
                 if(!listIsNested)