Jquery nestable how to prevent / reject a fall

Does anyone know how to prevent an item from getting to the root of the list. Or even more specifically - how can I limit it to only allowed elements in the dd-handle class.

I tried using the jquery.nestable.js plugin file in the dragStop method. I can intercept the drops in the root here, but not in a pure way prevents the action.

dragStop: function(e)
{
        var thePlace = this.pointEl.closest('.' + this.options.rootClass);
        if(thePlace.length < 1) {
            e.preventDefault;
            return false;
        }

 ...

}

Does anyone know a more efficient / authorized way to prevent a fall on specific goals?

+4
source share
1 answer

go to jquery.nestable.js file and search for onDragStart and add curly braces as shown below:

onDragStart: function (l, e, p) {event.preventDefault(); return false;},

!

0

All Articles