Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
added changeset & fixed PR issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lookacat committed Nov 3, 2021
1 parent ad04922 commit cd3fbf2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
7 changes: 7 additions & 0 deletions changelog/unreleased/enhancement-add-drag-drop-ghost
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Add Ghost Element for Drag & Drop

We've added a custom ghost element for the drag&drop functionality in the OcTableFiles to
better visualize the action to the user.

https://github.com/owncloud/web/issues/5788
https://github.com/owncloud/owncloud-design-system/pull/1754
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
</template>

<script>
/**
* Please head to the OcTableFiles component (https://owncloud.design/#/oC%20Components/OcTableFiles) for a demo of the Ghost Element.
*/
export default {
name: "GhostElement",
props: {
Expand All @@ -31,7 +34,7 @@ export default {
background-color: transparent;
padding-top: 4px;
padding-left: 5px;
z-index: 99999;
z-index: var(--oc-z-index-modal);
position: absolute;
.badge {
position: absolute;
Expand All @@ -52,7 +55,3 @@ export default {
}
}
</style>

<docs>

</docs>
6 changes: 1 addition & 5 deletions src/components/molecules/OcTable/OcTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,9 @@ export default {
methods: {
dragOver(event) {
event.preventDefault()
event.target.style.cursor = "move"
},
setGhostElement(file, event) {
const selection = this.selection
const selection = [...this.selection]
selection.splice(
selection.findIndex(function (i) {
return i.id === file.id
Expand All @@ -278,7 +277,6 @@ export default {
event.dataTransfer.setDragImage(ghost, 0, 0)
event.dataTransfer.dropEffect = "move"
event.dataTransfer.effectAllowed = "move"
event.target.style.cursor = "move"
},
dragStart(file, event) {
if (!this.dragDrop) return
Expand All @@ -292,8 +290,6 @@ export default {
const dropTarget = event.target
const dropTargetTr = dropTarget.closest("tr")
const dropFileId = dropTargetTr.dataset.fileId
event.target.style.cursor = "default"
this.dropRowStyling(id, true, event)
this.$emit(EVENT_FILE_DROPPED, dropFileId)
},
Expand Down

0 comments on commit cd3fbf2

Please sign in to comment.