From e7a6e3fd1b6fa956aa18d1304e084c9b134fcb89 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Wed, 10 Jul 2013 17:33:21 +0200 Subject: [PATCH] refactoring --- modules/documentCanvas/canvas/canvas.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/modules/documentCanvas/canvas/canvas.js b/modules/documentCanvas/canvas/canvas.js index e125db5..3eb4c6e 100644 --- a/modules/documentCanvas/canvas/canvas.js +++ b/modules/documentCanvas/canvas/canvas.js @@ -198,7 +198,7 @@ $.extend(Canvas.prototype.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); @@ -206,15 +206,9 @@ $.extend(Canvas.prototype.list, { 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) -- 2.20.1