Skip to content

Commit

Permalink
Merge pull request #19258 from jmchilton/stray_moving_24_2
Browse files Browse the repository at this point in the history
[24.2] Only allow moving activity bar icons when editing the bar.
  • Loading branch information
ahmedhamidawan authored Dec 5, 2024
2 parents 0f84879 + 73096b4 commit ea0308c
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 ea0308c

Please sign in to comment.