Skip to content

Commit

Permalink
Only allow moving activity bar icons when editing the bar.
Browse files Browse the repository at this point in the history
Add small visual indicator that they can be moved.
  • Loading branch information
jmchilton committed Dec 5, 2024
1 parent 316ac2e commit 73096b4
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion client/src/components/ActivityBar/ActivityBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ function setActiveSideBar(key: string) {
activityStore.toggledSideBar = key;
}
const canDrag = computed(() => {
return isActiveSideBar("settings");
});
defineExpose({
isActiveSideBar,
setActiveSideBar,
Expand All @@ -209,14 +213,18 @@ defineExpose({
<draggable
:list="activities"
:class="{ 'activity-popper-disabled': isDragging }"
:disabled="!canDrag"
:force-fallback="true"
chosen-class="activity-chosen-class"
:delay="DRAG_DELAY"
drag-class="activity-drag-class"
ghost-class="activity-chosen-class"
@start="isDragging = true"
@end="isDragging = false">
<div v-for="(activity, activityIndex) in activities" :key="activityIndex">
<div
v-for="(activity, activityIndex) in activities"
:key="activityIndex"
:class="{ 'can-drag': canDrag }">
<div v-if="activity.visible && (activity.anonymous || !isAnonymous)">
<UploadItem
v-if="activity.id === 'upload'"
Expand Down Expand Up @@ -380,4 +388,11 @@ defineExpose({
overflow-y: auto;
overflow-x: hidden;
}
.can-drag {
border-radius: 12px;
border: 1px;
outline: dashed darkgray;
outline-offset: -3px;
}
</style>

0 comments on commit 73096b4

Please sign in to comment.