From: Aleksander Ɓukasz Date: Wed, 10 Jul 2013 15:33:21 +0000 (+0200) Subject: refactoring X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/e7a6e3fd1b6fa956aa18d1304e084c9b134fcb89 refactoring --- 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)