Skip to content

Commit

Permalink
Merge pull request #1330 from nextcloud/fix/1329/moving-subtasks
Browse files Browse the repository at this point in the history
Only move dragged task
  • Loading branch information
raimund-schluessler committed Nov 5, 2020
2 parents 77f3cde + 389468a commit d0349e5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/TaskBody.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}"
:data-priority="[task.priority]"
class="task-item"
ref="taskItem"
@dragstart="dragStart($event)">
<div :task-id="task.uri"
:class="{active: isTaskOpen()}"
Expand Down Expand Up @@ -445,6 +446,11 @@ export default {
* @param {Object} e The drag event
*/
dragStart(e) {
// Only set the uri if it's the closest task to the drag event
// so we don't get the uri of the root task (the event bubbles up).
if (e.target.closest('.task-item') !== this.$refs.taskItem) {
return
}
e.dataTransfer.setData('text/plain', this.task.uri)
},
Expand Down

0 comments on commit d0349e5

Please sign in to comment.