mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
prevent click handler trigger when dragging the link and ignore drops on the element that triggered the dragging
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user