mjsarfatti/nestedSortable — pull request #17 by chrispitzer (2012-03-16 20:24:00+00:00)
Title: support for min and max level depth

We needed to have some items that could not be in the base of a list. Also, other items that could only be in the base of a list.

lunchbox 1
plastic bag
apple
chips
lunchbox 2
sandwich
cheese

So in this example, you should never have a sandwich outside a lunchbox - that would just be messy. Also, you should never have one lunchbox inside another, that would be silly.

So we added max_level and min_level options.

First, we initialized the nested list like so:
$('ol.sortable').nestedSortable({
disableNesting: 'no_nest',
levelMinDataAttribute: 'level_min',
levelMaxDataAttribute: 'level_max',
....
});

Second, we made our list like so:

lunchbox 1

Note - we're using underscores because of the funky way jquery/html5 munge data attribute keys. This sidesteps that.

Let us know if you have feedback.