Skip to content

Commit

Permalink
adjusting card size on drag
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSchuhmacher committed Apr 19, 2024
1 parent 1f5bfd3 commit dfe7630
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
13 changes: 12 additions & 1 deletion src/modules/feature/board/board/BoardColumn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
filter: '.v-input, v-btn',
preventOnFilter: false,
forceFallback: true,
ghostClass: 'sortable-drag-ghost',
ghostClass: sortableGhostClasses,
scroll: true,
}"
:class="sortableClasses"
Expand Down Expand Up @@ -283,6 +283,14 @@ export default defineComponent({
return classes;
});
const sortableGhostClasses = computed(() => {
const classes = ["sortable-drag-ghost"];
if (!props.isListBoard) {
classes.push("column-layout");
}
return classes;
});
return {
cardDropPlaceholderOptions,
columnClasses,
Expand All @@ -309,6 +317,7 @@ export default defineComponent({
getChildPayload,
reactiveIndex,
showAddButton,
sortableGhostClasses,
};
},
});
Expand All @@ -317,6 +326,8 @@ export default defineComponent({
<style>
.sortable-drag-ghost .v-card {
opacity: 0.6;
}
.column-layout {
width: 346px; /* size of the card - column has 400px width and some paddings and margins */
}
</style>
Expand Down
12 changes: 10 additions & 2 deletions src/modules/feature/board/board/BoardColumnGhost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
direction: 'vertical',
delay: 300, // isDesktop ? 0 : 300
delayOnTouchOnly: true,
ghostClass: 'sortable-drag-ghost',
ghostClass: sortableGhostClasses,
easing: 'cubic-bezier(1, 0, 0, 1)',
dragClass: 'sortable-drag-board-card',
dragoverBubble: false,
Expand Down Expand Up @@ -66,6 +66,14 @@ const ghostColumnStyle = computed(() => {
}
return classes;
});
const sortableGhostClasses = computed(() => {
const classes = ["sortable-drag-ghost"];
if (!props.isListBoard) {
classes.push("column-layout");
}
return classes;
});
</script>

<style scoped>
Expand Down Expand Up @@ -95,7 +103,7 @@ const ghostColumnStyle = computed(() => {
</style>

<style>
.sortable-drag-ghost {
.column-layout {
width: 350px !important;
}
</style>

0 comments on commit dfe7630

Please sign in to comment.