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',
|
restrict : 'A',
|
||||||
link : function(scope, element, attrs) {
|
link : function(scope, element, attrs) {
|
||||||
element.draggable({
|
element.draggable({
|
||||||
|
revert: 'invalid',
|
||||||
|
helper: 'clone',
|
||||||
axis: 'y'
|
axis: 'y'
|
||||||
}).data('source', scope.$eval(attrs.draggable));
|
}).data('source', scope.$eval(attrs.draggable));
|
||||||
}
|
}
|
||||||
@@ -385,6 +387,10 @@ module.directive('droppable', [ 'CategoryService', 'FeedService', function(Categ
|
|||||||
var source = draggable.data('source');
|
var source = draggable.data('source');
|
||||||
var target = scope.$eval(attrs.droppable);
|
var target = scope.$eval(attrs.droppable);
|
||||||
|
|
||||||
|
if (angular.equals(source, target)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
id: source.id,
|
id: source.id,
|
||||||
name: source.name
|
name: source.name
|
||||||
|
|||||||
Reference in New Issue
Block a user