Skip to content

Added support for drag handles that contain nested elements. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ashleydavis
Copy link

Added code to walk up the DOM from the dragged element to search for the element that is marked with the drag handle class.

This upgrades the 'drag handle' feature to work with handles that contain nested elements such as the following:

<div
    ng-repeat="..."
    dnd-draggable="item"
    dnd-handle-class="drag-handle"
    >
    <span
        class="drag-handle"
        >                                                 <!-- This is the drag handle. -->
        <i class="fa fa-reorder"></i> <!-- This is the clicked element -->
    </span>

    ...
</div>

…the element that is marked with the drag handle class.

This upgrades the 'drag handle' feature to work with handles that contain nested elements such as the following:

    <div
        ng-repeat="..."
        dnd-draggable="item"
        dnd-handle-class="drag-handle"
        >
        <span
            class="drag-handle"
            >                                                 <!-- This is the drag handle. -->
            <i class="fa fa-reorder"></i> <!-- This is the clicked element -->
        </span>

        ...
    </div>
…erty to determine if there is any ancestor remaining to be checked.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant