fatlinesofcode / ngDraggable

Drag and drop module for Angular JS
MIT License
631 stars 400 forks source link

ng-drop-success is getting called twice. #255

Open anagh-p opened 8 years ago

anagh-p commented 8 years ago

I'm trying to create a kanban board which will use two ng-repeats(nested). One will be for the column, and second will be for the items inside each of these columns.

These are the three kinds of operations(drag and drop) that I am going to do.

  1. Item to item.
  2. Item to heading. //Not important for my problem here.
  3. Item to column.

ISSUE : When I do the Operation 1 from above, first, Operation 3 is triggered. Only then the Operation 1 is triggered.

In other words, the drop gets triggered for the parent div first, and only then it is called for the child div.

QUESTION : Is it possible to disable this scenario? I mean, I need only the item to item(child to child) operation to happen. When this is happening, the item to column(child to parent) operation is irrelevant.

P.S : I went through https://github.com/fatlinesofcode/ngDraggable/issues/223 , but that didn't solve my problem. Any help will be appreciated. Thanks in advance.

        `<div class="board-column"
             ng-drop="true"
             ng-drag="true"
             ng-drop-success="dropComplete()"
             ng-repeat="cars in brands track by $index"> //**************COLUMN**************

            <!--Heading - Start-->
            <div ng-drop="true"
                 ng-drop-success="dropComplete()"
                 class="board-heading">
                {{BRAND}}
            </div> //**************HEADING**************
            <!--Heading - End-->

            <!--Items - Start-->
            <div ng-repeat="car in cars track by $index"                         
                 ng-drop="true"                         
                 ng-drop-success="dropComplete()"
                 class="board-item">

                <div ng-drag="true"
                     ng-drag-data="MY DATA"
                     class="board-item-draggable">
                    {{CAR NAME}}
                </div>

            </div>//**************ITEM**************
            <!--Items - End-->

        </div>`
aykutdemirel commented 7 years ago

+1