prevent click handler trigger when dragging the link and ignore drops on the element that triggered the dragging

This commit is contained in:
Athou
2013-06-02 19:37:35 +02:00
parent 555f35407b
commit 3c5dfc2d89

View File

@@ -364,6 +364,8 @@ module.directive('draggable', function() {
restrict : 'A',
link : function(scope, element, attrs) {
element.draggable({
revert: 'invalid',
helper: 'clone',
axis: 'y'
}).data('source', scope.$eval(attrs.draggable));
}
@@ -385,6 +387,10 @@ module.directive('droppable', [ 'CategoryService', 'FeedService', function(Categ
var source = draggable.data('source');
var target = scope.$eval(attrs.droppable);
if (angular.equals(source, target)) {
return;
}
var data = {
id: source.id,
name: source.name