feat: init drag and drop requests on team collections

This commit is contained in:
liyasthomas
2021-12-18 17:10:20 +05:30
parent d305168dc3
commit 11fe908017
3 changed files with 39 additions and 2 deletions

View File

@@ -1,7 +1,13 @@
<template>
<div class="flex flex-col">
<div class="flex flex-col" :class="[{ 'bg-primaryLight': dragging }]">
<div
class="flex items-stretch group"
@dragover.prevent
@drop.prevent="dropEvent"
@dragover="dragging = true"
@drop="dragging = false"
@dragleave="dragging = false"
@dragend="dragging = false"
@contextmenu.prevent="$refs.options.tippy().show()"
>
<span
@@ -178,6 +184,7 @@ export default defineComponent({
data() {
return {
showChildren: false,
dragging: false,
confirmRemove: false,
prevCursor: "",
cursor: "",
@@ -238,6 +245,12 @@ export default defineComponent({
expandCollection(collectionID) {
this.$emit("expand-collection", collectionID)
},
dropEvent({ dataTransfer }) {
this.dragging = !this.dragging
const requestIndex = dataTransfer.getData("requestIndex")
console.log(requestIndex, this.folder.id)
// moveRESTTeamRequest(this.folder.id, requestIndex)
},
removeRequest({ collectionIndex, folderName, requestIndex }) {
this.$emit("remove-request", {
collectionIndex,