diff --git a/src/components/Questions/AnswerInput.vue b/src/components/Questions/AnswerInput.vue
index c355b59be..aca06b1d2 100644
--- a/src/components/Questions/AnswerInput.vue
+++ b/src/components/Questions/AnswerInput.vue
@@ -28,34 +28,36 @@
-
+
-
+
-
+
+
+
+
+ {{ t('forms', 'Move option up') }}
+
+
+
+
+
+ {{ t('forms', 'Move option down') }}
+
+
-
-
-
-
-
@@ -74,13 +76,17 @@ import axios from '@nextcloud/axios'
import debounce from 'debounce'
import PQueue from 'p-queue'
-import NcButton from '@nextcloud/vue/components/NcButton'
import IconArrowDown from 'vue-material-design-icons/ArrowDown.vue'
import IconArrowUp from 'vue-material-design-icons/ArrowUp.vue'
-import IconDelete from 'vue-material-design-icons/Delete.vue'
import IconCheckboxBlankOutline from 'vue-material-design-icons/CheckboxBlankOutline.vue'
+import IconDelete from 'vue-material-design-icons/Delete.vue'
+import IconDragIndicator from '../Icons/IconDragIndicator.vue'
import IconRadioboxBlank from 'vue-material-design-icons/RadioboxBlank.vue'
+import NcActions from '@nextcloud/vue/components/NcActions'
+import NcActionButton from '@nextcloud/vue/components/NcActionButton'
+import NcButton from '@nextcloud/vue/components/NcButton'
+
import OcsResponse2Data from '../../utils/OcsResponse2Data.js'
import logger from '../../utils/Logger.js'
@@ -92,7 +98,10 @@ export default {
IconArrowUp,
IconCheckboxBlankOutline,
IconDelete,
+ IconDragIndicator,
IconRadioboxBlank,
+ NcActions,
+ NcActionButton,
NcButton,
},
@@ -145,6 +154,10 @@ export default {
})
},
+ optionDragMenuId() {
+ return 'q' + this.answer.questionId + 'o' + this.index + '__drag_menu'
+ },
+
placeholder() {
if (this.answer.local) {
return t('forms', 'Add a new answer option')
@@ -171,13 +184,6 @@ export default {
this.$emit('tabbed-out')
},
- /**
- * Focus the input
- */
- focus() {
- this.$refs.input?.focus()
- },
-
/**
* Option changed, processing the data
*
@@ -356,7 +362,7 @@ export default {
&__pseudoInput {
color: var(--color-primary-element);
- margin-inline-start: calc(-1 * var(--default-grid-baseline));
+ margin-inline-start: -2px;
z-index: 1;
}
@@ -364,15 +370,28 @@ export default {
display: flex;
position: absolute;
gap: var(--default-grid-baseline);
- inset-inline-end: 16px;
- height: var(--default-clickable-area);
- }
-
- .option__actions-button {
margin-block: auto;
+ inset-inline-end: 12px;
+ height: 100%;
+
+ .option__drag-handle {
+ top: 4px;
+ opacity: 0.5;
+ cursor: grab;
+
+ &:hover,
+ &:focus,
+ &:focus-within {
+ opacity: 1;
+ }
- &:last-of-type {
- margin-inline: 5px;
+ &:active {
+ cursor: grabbing;
+ }
+
+ > * {
+ cursor: grab;
+ }
}
}
@@ -380,7 +399,6 @@ export default {
width: calc(100% - var(--default-clickable-area));
position: relative;
inset-inline-start: -12px;
- margin-block: 0 !important;
margin-inline-end: -12px !important;
&--shifted {
diff --git a/src/components/Questions/QuestionDropdown.vue b/src/components/Questions/QuestionDropdown.vue
index fd36b4f26..9c56003fe 100644
--- a/src/components/Questions/QuestionDropdown.vue
+++ b/src/components/Questions/QuestionDropdown.vue
@@ -40,27 +40,41 @@
-
-
-
-
+
+
+
+
+
+
@@ -71,6 +85,8 @@