Skip to content
This repository has been archived by the owner on Jun 19, 2018. It is now read-only.

Commit

Permalink
fix(droppable): allow the drop active class to be customised
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Lewis committed Mar 22, 2016
1 parent ad9beb7 commit fc85410
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/directives/mwlDroppable.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ angular
return;
}

var DROP_ACTIVE_CLASS = $attrs.dropActiveClass || 'drop-active';

interact($element[0]).dropzone({
ondragenter: function(event) {
angular.element(event.target).addClass('drop-active');
angular.element(event.target).addClass(DROP_ACTIVE_CLASS);
},
ondragleave: function(event) {
angular.element(event.target).removeClass('drop-active');
angular.element(event.target).removeClass(DROP_ACTIVE_CLASS);
},
ondropdeactivate: function(event) {
angular.element(event.target).removeClass('drop-active');
angular.element(event.target).removeClass(DROP_ACTIVE_CLASS);
},
ondrop: function(event) {
if (event.relatedTarget.dropData) {
Expand Down

0 comments on commit fc85410

Please sign in to comment.