Skip to content

Empty div doesn't go away after adding nodes #104

@hareluya86

Description

@hareluya86

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions