X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/3303f7533b86892774f011ac54bfd69c6092ea5a..a91d838aca2cb6b1330454a6e92616a73a2e1255:/modules/documentCanvas/canvas/canvas.js diff --git a/modules/documentCanvas/canvas/canvas.js b/modules/documentCanvas/canvas/canvas.js index a274fa4..d883835 100644 --- a/modules/documentCanvas/canvas/canvas.js +++ b/modules/documentCanvas/canvas/canvas.js @@ -196,13 +196,17 @@ $.extend(Canvas.prototype.list, { last = item; }); - var secondList = documentElement.DocumentNodeElement.create({tag: 'div', klass:'list-items'}, this); + if(list.children().length === 0) + list.detach(); - last.after(secondList); + if(succeedingItems.length > 0) { + var secondList = documentElement.DocumentNodeElement.create({tag: 'div', klass:'list-items'}, this); + last.after(secondList); - succeedingItems.forEach(function(item) { - secondList.append(item); - }); + succeedingItems.forEach(function(item) { + secondList.append(item); + }); + } } });