Skip to content

Commit 7283bc3

Browse files
committed
fix sorting options
Signed-off-by: dartcafe <github@dartcafe.de>
1 parent 3ab40ab commit 7283bc3

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/components/Options/OptionsText.vue

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,15 @@ import { nextTick, useTemplateRef } from 'vue'
88
import { useSortable } from '@vueuse/integrations/useSortable'
99
1010
import { t } from '@nextcloud/l10n'
11-
import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'
1211
import NcActions from '@nextcloud/vue/components/NcActions'
1312
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
1413
1514
import DeleteIcon from 'vue-material-design-icons/TrashCanOutline.vue'
1615
import RestoreIcon from 'vue-material-design-icons/RecycleVariant.vue'
17-
import TextPollIcon from 'vue-material-design-icons/FormatListBulletedSquare.vue'
1816
import ConfirmIcon from 'vue-material-design-icons/CheckboxBlankOutline.vue'
1917
import UnconfirmIcon from 'vue-material-design-icons/CheckboxMarkedOutline.vue'
2018
2119
import OptionItem from './OptionItem.vue'
22-
import OptionsTextAdd from './OptionsTextAdd.vue'
2320
import { usePollStore } from '../../stores/poll'
2421
import { useOptionsStore } from '../../stores/options'
2522
@@ -60,8 +57,7 @@ function onSort(event: { oldIndex: number; newIndex: number }) {
6057
</script>
6158

6259
<template>
63-
<OptionsTextAdd v-if="!pollStore.isClosed" />
64-
<div v-if="optionsStore.options.length" ref="list" :style="cssVar">
60+
<div ref="list" :style="cssVar">
6561
<div
6662
v-for="option in optionsStore.options"
6763
:key="option.id"
@@ -115,15 +111,6 @@ function onSort(event: { oldIndex: number; newIndex: number }) {
115111
</OptionItem>
116112
</div>
117113
</div>
118-
119-
<NcEmptyContent
120-
v-else
121-
:name="t('polls', 'No vote options')"
122-
:description="t('polls', 'Add some!')">
123-
<template #icon>
124-
<TextPollIcon />
125-
</template>
126-
</NcEmptyContent>
127114
</template>
128115

129116
<style lang="scss">

src/components/SideBar/SideBarTabOptions.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import TextOptionsIcon from 'vue-material-design-icons/FormatListBulletedSquare.
2323
import OptionsTextAddBulk from '../Options/OptionsTextAddBulk.vue'
2424
import ActionAddOption from '../Actions/modules/ActionAddOption.vue'
2525
import { Event } from '../../Types'
26+
import OptionsTextAdd from '../Options/OptionsTextAdd.vue'
27+
import { NcEmptyContent } from '@nextcloud/vue'
2628
2729
const optionsStore = useOptionsStore()
2830
const pollStore = usePollStore()
@@ -100,7 +102,18 @@ onUnmounted(() => {
100102
<TextOptionsIcon />
101103
</template>
102104

103-
<OptionsText />
105+
<OptionsTextAdd v-if="!pollStore.isClosed" />
106+
107+
<OptionsText v-if="optionsStore.options.length" />
108+
109+
<NcEmptyContent
110+
v-else
111+
:name="t('polls', 'No vote options')"
112+
:description="t('polls', 'Add some!')">
113+
<template #icon>
114+
<TextOptionsIcon />
115+
</template>
116+
</NcEmptyContent>
104117

105118
<template #actions>
106119
<OptionsTextAddBulk v-if="!pollStore.isClosed" />

0 commit comments

Comments
 (0)