Skip to content

Commit ed26960

Browse files
committed
refactor: AppDraggable and AppDragIcon
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
1 parent d5926ee commit ed26960

File tree

10 files changed

+17
-33
lines changed

10 files changed

+17
-33
lines changed

src/components/settings/macros/MacroCategorySettings.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,7 @@
5555
<app-draggable
5656
v-model="macros"
5757
:options="{
58-
animation: 200,
59-
handle: '.handle',
6058
group: `macro-settings-${category.name}`,
61-
ghostClass: 'ghost'
6259
}"
6360
>
6461
<section

src/components/settings/macros/MacroSettings.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@
2828
<app-draggable
2929
v-model="categories"
3030
:options="{
31-
animation: 200,
32-
handle: '.handle',
3331
group: `macro-settings`,
34-
ghostClass: 'ghost'
3532
}"
3633
>
3734
<section

src/components/ui/AppColumnPicker.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@
3232
<app-draggable
3333
v-model="configurableHeaders"
3434
:options="{
35-
animation: '200',
36-
handle: '.handle',
3735
group: 'columnPicker',
38-
ghostClass: 'ghost',
3936
}"
4037
>
4138
<template v-for="header in configurableHeaders">

src/components/ui/AppDragIcon.vue

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
11
<template>
22
<div class="handle-container">
33
<v-icon>
4-
{{ icon }}
4+
$drag
55
</v-icon>
6-
<div
7-
class="handle"
8-
:style="{
9-
cursor: cursor
10-
}"
11-
/>
6+
<div class="handle" />
127
</div>
138
</template>
149

1510
<script lang="ts">
16-
import { Component, Prop, Vue } from 'vue-property-decorator'
11+
import { Component, Vue } from 'vue-property-decorator'
1712
1813
@Component({})
1914
export default class AppDraggable extends Vue {
20-
@Prop({ type: String, default: '$drag' })
21-
readonly icon?: string
22-
23-
@Prop({ type: String, default: 'grab' })
24-
readonly cursor?: string
2515
}
2616
</script>
2717

@@ -43,5 +33,10 @@ export default class AppDraggable extends Vue {
4333
top: calc(50% - 24px);
4434
margin: 7px;
4535
border-radius: 50%;
36+
cursor: grab;
37+
}
38+
39+
.app-draggable__chosen .handle {
40+
cursor: grabbing;
4641
}
4742
</style>

src/components/ui/AppDraggable.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ export default class AppDraggable extends Vue {
122122
targetElement[instanceKey] = this
123123
124124
const options: Sortable.Options = {
125+
animation: 200,
126+
handle: '.handle',
127+
ghostClass: 'app-draggable__ghost',
128+
chosenClass: 'app-draggable__chosen',
125129
...this.options,
126130
onStart: this.handleStart,
127131
onAdd: this.handleAdd,

src/components/widgets/job-queue/JobQueueBrowser.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
<app-draggable
44
v-model="jobs"
55
:options="{
6-
animation: '200',
7-
handle: '.handle',
86
group: 'jobQueue',
9-
ghostClass: 'ghost',
107
}"
118
target="tbody"
129
>

src/components/widgets/job-queue/JobQueueCard.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
<app-btn
2727
v-else-if="queueStatus === 'paused'"
2828
small
29-
class="me-1 my-1"
29+
class="my-1"
30+
:class="{
31+
'me-1': !fullscreen
32+
}"
3033
@click="handleResume"
3134
>
3235
<v-icon

src/scss/draggable.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
transition: transform 0s;
99
}
1010

11-
.ghost {
11+
.app-draggable__ghost {
1212
opacity: 0.5;
1313
background: #ccc;
1414
}

src/views/Dashboard.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
v-model="containers[containerIndex]"
1414
class="list-group"
1515
:options="{
16-
animation: 200,
17-
handle: '.handle',
1816
group: 'dashboard',
1917
disabled: !inLayout,
20-
ghostClass: 'ghost'
2118
}"
2219
target=":first-child"
2320
@end="handleUpdateLayout"

src/views/Diagnostics.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,8 @@
4040
v-model="containers[containerIndex]"
4141
class="list-group"
4242
:options="{
43-
animation: 200,
44-
handle: '.handle',
4543
group: 'diagnostics',
4644
disabled: !inLayout,
47-
ghostClass: 'ghost'
4845
}"
4946
target=":first-child"
5047
@end.stop="updateLayout"

0 commit comments

Comments
 (0)