Nestable2 icon indicating copy to clipboard operation
Nestable2 copied to clipboard

Empty div doesn't go away after adding nodes

Open hareluya86 opened this issue 6 years ago • 0 comments

Using $('.dd').nestable('add', jsonObj) on an empty initial container like

<div id="selections_nested" class="col-md-6">
    <ol class="dd-list"></ol>
</div>

will produce an empty div <div class="dd-empty"/> remaining regardless of how many nodes I've add. This empty div was initiated but should be removed when new nodes are added and the tree is no longer empty.

I have added a line in 251 to check if the the tree contains an empty div and remove it if it exists:

if(tree.find('.'+this.options.emptyClass))
    this.removeEmptyElement(this.el);

Let me know if this is a good fix or is there any better way.

hareluya86 avatar Mar 26 '18 12:03 hareluya86