Skip to content

Event on Dropzone Hover #2159

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

Closed
ghost opened this issue May 17, 2022 · 1 comment
Closed

Event on Dropzone Hover #2159

ghost opened this issue May 17, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented May 17, 2022

Is there a way to fire an event when the dragged element hovers over the dropzone? I'd love to be able to give some additional visual feedback when the element can be dropped.

@ghost
Copy link
Author

ghost commented May 18, 2022

                  new Sortable(this, {
                        group: "kanban",
                        dataIdAttr: 'data-id',
                        ghostClass: 'move-card-dropzone',
                        filter: ".main-kanban-dropzone-title .main-kanban-dropzone-bg",
                        draggable: ".kanban-card",
                        onAdd: function (evt) {
                            evt.item.parentNode.removeChild(evt.item);
                        },
                    });

                    this.addEventListener('dragenter', function(evt) {

                        if (!$(this).hasClass('main-kanban-dropzone-active')) {
                            $(this).addClass('main-kanban-dropzone-active');
                        }

                    });
                    this.addEventListener('dragleave', function(evt) {

                        if (!this.contains(evt.relatedTarget)) {
                            $(this).removeClass('main-kanban-dropzone-active');
                        }

                    });

its work

This issue was closed.
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

No branches or pull requests

0 participants