Don't hide source element when it is copied

This commit is contained in:
Raimund Schlüßler 2016-03-16 21:34:43 +01:00
parent 8314f481ef
commit dd88d786f9
7 changed files with 35 additions and 2 deletions

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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) }}">
<?php print_unescaped($this->inc('part.taskbody')); ?>
</li>

View file

@ -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) }}">
<?php print_unescaped($this->inc('part.taskbody')); ?>
</li>

View file

@ -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) }}">
</li>
</ol>

View file

@ -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) }}">
<?php print_unescaped($this->inc('part.taskbody')); ?>
</li>
@ -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) }}">
<?php print_unescaped($this->inc('part.taskbody')); ?>
</li>