Prevent dropping on collection when copying task

This commit is contained in:
Raimund Schlüßler 2016-03-16 23:02:20 +01:00
parent 74fba33ec8
commit 80d517cfd5
3 changed files with 8 additions and 2 deletions

View file

@ -169,6 +169,9 @@ angular.module('Tasks').controller('ListController', [
};
this._$scope.dragoverCollection = function($event, item, index) {
if ($event.dataTransfer.effectAllowed === 'copy' || ($event.dataTransfer.effectAllowed === 'copyMove' && $event.ctrlKey)) {
return false;
}
var collectionID;
collectionID = $($event.target).closest('li.collection').attr('collectionID');
return collectionID === 'starred' || collectionID === 'completed' || collectionID === 'today';

View file

@ -722,6 +722,9 @@ angular.module('Tasks').controller('ListController', [
};
this._$scope.dragoverCollection = function($event, item, index) {
if ($event.dataTransfer.effectAllowed === 'copy' || ($event.dataTransfer.effectAllowed === 'copyMove' && $event.ctrlKey)) {
return false;
}
var collectionID;
collectionID = $($event.target).closest('li.collection').attr('collectionID');
return collectionID === 'starred' || collectionID === 'completed' || collectionID === 'today';

View file

@ -23,7 +23,7 @@
ng-repeat="collection in collections"
ng-class="{'animate-up': hideCollection(collection.id), active: collection.id==route.collectionID}"
dnd-list="draggedTasks"
dnd-drop="dropCollection(event, item, index)"
dnd-drop="dropCollection(event, index, item)"
dnd-dragover="dragoverCollection(event, index)">
<a href="#/collections/{{ collection.id }}">
<span class="icon collection-{{ collection.id }}">
@ -43,7 +43,7 @@
ng-repeat="calendar in calendars"
ng-class="{active: calendar.uri==route.calendarID, edit:route.listparameter == 'name' && route.calendarID == calendar.uri}"
dnd-list="draggedTasks"
dnd-drop="dropList(event, item, index)"
dnd-drop="dropList(event, index, item)"
dnd-dragover="dragoverList(event, index)">
<a href="#/calendars/{{ calendar.uri }}" style="border-right: 4px solid {{ calendar.color }};" ng-dblclick="startRename(calendar)">
<span class="icon list-list"></span>