Closed mdrx-io closed 10 years ago
It isn't built in because the Dropzone
doesn't have a reference to all possible Draggable
s.
But you can do it by listening to the onDragStart
and onDragEnd
events:
Draggable draggable = new Draggable(draggableElements,
avatarHandler: new AvatarHandler.clone());
Dropzone dropzone = new Dropzone(dropzoneElements);
// Add class when dragging starts and remove it when dragging ends.
draggable.onDragStart.listen((_) {
dropzoneElements.classes.add('drop-here');
});
draggable.onDragEnd.listen((_) {
dropzoneElements.classes.remove('drop-here');
});
Please correct me if you've already built in this feature to the API in some form. But I would like to be able to add a class to acceptable Dropzones for a Draggable on dragStart. The goal being to give the user hints as to where she might be able to drop a Draggable (like a border-color modification around the Dropzone element).