diff --git a/css/style.css b/css/style.css index f286bb52..e8b14e17 100644 --- a/css/style.css +++ b/css/style.css @@ -1430,6 +1430,9 @@ div.percentdone { ol[dnd-list] .dndDraggingSource { display: none; } +ol[dnd-list] .copy.dndDraggingSource { + display: block; +} /** * An element with .dndPlaceholder class will be * added to the dnd-list while the user is dragging diff --git a/js/app/controllers/taskscontroller.js b/js/app/controllers/taskscontroller.js index 7b8d6bce..ad19778e 100644 --- a/js/app/controllers/taskscontroller.js +++ b/js/app/controllers/taskscontroller.js @@ -344,7 +344,17 @@ } else { return "copy"; } - } + }; + + this._$scope.dragStart = function($event) { + if ($event.dataTransfer.effectAllowed === 'copy' || ($event.dataTransfer.effectAllowed === 'copyMove' && $event.ctrlKey)) { + $($event.target).addClass('copy'); + } + }; + + this._$scope.dragEnd = function($event) { + $($event.target).removeClass('copy'); + }; } return TasksController; diff --git a/js/public/app.js b/js/public/app.js index 52a3a0e1..820290ce 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -1135,7 +1135,17 @@ angular.module('Tasks').controller('SettingsController', [ } else { return "copy"; } - } + }; + + this._$scope.dragStart = function($event) { + if ($event.dataTransfer.effectAllowed === 'copy' || ($event.dataTransfer.effectAllowed === 'copyMove' && $event.ctrlKey)) { + $($event.target).addClass('copy'); + } + }; + + this._$scope.dragEnd = function($event) { + $($event.target).removeClass('copy'); + }; } return TasksController; diff --git a/templates/part.collectionall.php b/templates/part.collectionall.php index 35cfbcad..fc82dfe7 100644 --- a/templates/part.collectionall.php +++ b/templates/part.collectionall.php @@ -18,6 +18,8 @@ ng-click="openDetails(task.uri,$event)" ng-class="{done: task.completed}" dnd-draggable="task" + dnd-dragstart="dragStart(event)" + dnd-dragend="dragEnd(event)" dnd-effect-allowed="{{ allow(task) }}"> inc('part.taskbody')); ?> diff --git a/templates/part.collectionweek.php b/templates/part.collectionweek.php index 765757bd..a828e767 100644 --- a/templates/part.collectionweek.php +++ b/templates/part.collectionweek.php @@ -17,6 +17,8 @@ ng-click="openDetails(task.uri,$event)" ng-class="{done: task.completed}" dnd-draggable="task" + dnd-dragstart="dragStart(event)" + dnd-dragend="dragEnd(event)" dnd-effect-allowed="{{ allow(task) }}"> inc('part.taskbody')); ?> diff --git a/templates/part.taskbody.php b/templates/part.taskbody.php index 78cec9d0..4046ddee 100644 --- a/templates/part.taskbody.php +++ b/templates/part.taskbody.php @@ -54,6 +54,8 @@ ng-class="{done: task.completed}" ng-include="'part.taskbody'" dnd-draggable="task" + dnd-dragstart="dragStart(event)" + dnd-dragend="dragEnd(event)" dnd-effect-allowed="{{ allow(task) }}"> diff --git a/templates/part.tasklist.php b/templates/part.tasklist.php index d51943a7..04da5d2d 100644 --- a/templates/part.tasklist.php +++ b/templates/part.tasklist.php @@ -15,6 +15,8 @@ ng-click="openDetails(task.uri,$event)" ng-class="{done: task.completed}" dnd-draggable="task" + dnd-dragstart="dragStart(event)" + dnd-dragend="dragEnd(event)" dnd-effect-allowed="{{ allow(task) }}"> inc('part.taskbody')); ?> @@ -35,6 +37,8 @@ ng-click="openDetails(task.uri,$event)" ng-class="{done: task.completed}" dnd-draggable="task" + dnd-dragstart="dragStart(event)" + dnd-dragend="dragEnd(event)" dnd-effect-allowed="{{ allow(task) }}"> inc('part.taskbody')); ?>