codef0rmer / angular-dragdrop

Implementing jQueryUI Drag and Drop functionality in AngularJS (with Animation) is easier than ever
http://codef0rmer.github.com/angular-dragdrop/#/
MIT License
1.78k stars 574 forks source link

force droppable area to accept draggrable object has class .food #313

Closed m-saifuddin closed 7 years ago

m-saifuddin commented 7 years ago

Hi,

I am trying to restrict a droppable element to only accept draggable object has class .food and to do that I put 'accept': .food in jqyoui-droppable attribute but this still accepting other class object.

<div class="food" data-jqyoui-options="{revert: 'invalid'}" data-drag="true" ng-model="food2" jqyoui-draggable="{animate: true}" ng-hide="!food2.title">
                    <img id="fooditem" src="{{food2.src}}"/>
                </div>

<ol data-drop="true" ng-model='list2' jqyoui-droppable="{accept:'.food', onOver:'onOver'}" class="basketList">

Any help would be great.

Cheers!!

codef0rmer commented 7 years ago

@m-saifuddin You must add the accept configurations in data-jqyoui-options not jqyoui-droppable because it's specific to angular-dragdrop not jqueryUI.