Skip to content

Instantly share code, notes, and snippets.

@nummi
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save nummi/35f45078ee04fee21a94 to your computer and use it in GitHub Desktop.

Select an option

Save nummi/35f45078ee04fee21a94 to your computer and use it in GitHub Desktop.
import Ember from 'ember';
var cancelDragEvent = function(e) {
e.preventDefault();
e.stopPropagation();
return false;
};
export default {
dragItem: null,
cancel: function(e) { return cancelDragEvent(e); },
DraggableMixin: Ember.Mixin.create({
attributeBindings: ['draggable'],
draggable: true,
dragStart: function() { throw 'Implement dragStart'; }
}),
DroppableMixin: Ember.Mixin.create({
_dragEnter: function(e) {
return cancelDragEvent(e);
}.on('dragEnter'),
_dragOver: function(e) {
return cancelDragEvent(e);
}.on('dragOver'),
drop: function() { throw 'Implement drop'; }
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment