Skip to content
This repository was archived by the owner on Mar 10, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions angular-drag-and-drop-lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,18 @@ angular.module('dndLists', [])
var horizontal = attr.dndHorizontalList && scope.$eval(attr.dndHorizontalList);
var externalSources = attr.dndExternalSources && scope.$eval(attr.dndExternalSources);

/**
* The dragenter is triggered prior to the dragover and to allow
* a drop the event handler must preventDefault().
*/
element.on('dragenter', function (event) {
event = event.originalEvent || event;

if (!isDropAllowed(event)) return true;

event.preventDefault();
});

/**
* The dragover event is triggered "every few hundred milliseconds" while an element
* is being dragged over our list, or over an child element.
Expand Down