Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only move dragged task #1330

Merged
merged 1 commit into from
Nov 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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