Skip to content

Commit 172f56c

Browse files
committed
move insert-menu to question slot
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
1 parent 0cc3402 commit 172f56c

12 files changed

Lines changed: 122 additions & 87 deletions

src/components/Questions/Question.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@
157157

158158
<!-- Question content -->
159159
<slot />
160+
<!-- Insert question menu -->
161+
<slot name="insert" />
160162
</li>
161163
</template>
162164

src/components/Questions/QuestionColor.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
</NcButton>
3636
</div>
3737
</div>
38+
<template #insert>
39+
<slot name="insert" />
40+
</template>
3841
</Question>
3942
</template>
4043

src/components/Questions/QuestionDate.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@
9898
rangeSeparator=" - "
9999
@update:modelValue="onValueChange" />
100100
</div>
101+
<template #insert>
102+
<slot name="insert" />
103+
</template>
101104
</Question>
102105
</template>
103106

src/components/Questions/QuestionDropdown.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@
5555
handle=".option__drag-handle"
5656
invertSwap
5757
tag="transition-group"
58-
:componentData="{
59-
name: isDragging
58+
:name="
59+
isDragging
6060
? 'no-external-transition-on-drag'
61-
: 'options-list-transition',
62-
}"
61+
: 'options-list-transition'
62+
"
6363
@change="saveOptionsOrder('choice')"
6464
@start="isDragging = true"
6565
@end="isDragging = false">
@@ -89,6 +89,9 @@
8989
<OptionInputDialog
9090
v-model:open="isOptionDialogShown"
9191
@multipleAnswers="handleMultipleOptions" />
92+
<template #insert>
93+
<slot name="insert" />
94+
</template>
9295
</Question>
9396
</template>
9497

src/components/Questions/QuestionFile.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@
141141
</li>
142142
</ul>
143143
</div>
144+
<template #insert>
145+
<slot name="insert" />
146+
</template>
144147
</Question>
145148
</template>
146149

src/components/Questions/QuestionGrid.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@
139139
handle=".option__drag-handle"
140140
invertSwap
141141
tag="transition-group"
142-
:componentData="{
143-
name: isDragging
142+
:name="
143+
isDragging
144144
? 'no-external-transition-on-drag'
145-
: 'options-list-transition',
146-
}"
145+
: 'options-list-transition'
146+
"
147147
@change="saveOptionsOrder('row')"
148148
@start="isDragging = true"
149149
@end="isDragging = false">
@@ -169,6 +169,9 @@
169169
</Draggable>
170170
</template>
171171
</template>
172+
<template #insert>
173+
<slot name="insert" />
174+
</template>
172175
</Question>
173176
</template>
174177

src/components/Questions/QuestionLinearScale.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@
107107
{{ optionsLabelHighest }}
108108
</div>
109109
</div>
110+
<template #insert>
111+
<slot name="insert" />
112+
</template>
110113
</Question>
111114
</template>
112115

src/components/Questions/QuestionLong.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
@keypress="autoSizeText"
2828
@keydown.ctrl.enter="onKeydownCtrlEnter" />
2929
</div>
30+
<template #insert>
31+
<slot name="insert" />
32+
</template>
3033
</Question>
3134
</template>
3235

src/components/Questions/QuestionMultiple.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@
126126
handle=".option__drag-handle"
127127
invertSwap
128128
tag="transition-group"
129-
:componentData="{
130-
name: isDragging
129+
:name="
130+
isDragging
131131
? 'no-external-transition-on-drag'
132-
: 'options-list-transition',
133-
}"
132+
: 'options-list-transition'
133+
"
134134
@change="saveOptionsOrder('choice')"
135135
@start="isDragging = true"
136136
@end="isDragging = false">
@@ -176,6 +176,9 @@
176176
<OptionInputDialog
177177
v-model:open="isOptionDialogShown"
178178
@multipleAnswers="handleMultipleOptions" />
179+
<template #insert>
180+
<slot name="insert" />
181+
</template>
179182
</Question>
180183
</template>
181184

src/components/Questions/QuestionRanking.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@
133133
handle=".option__drag-handle"
134134
invertSwap
135135
tag="transition-group"
136-
:componentData="{
137-
name: isDragging
136+
:name="
137+
isDragging
138138
? 'no-external-transition-on-drag'
139-
: 'options-list-transition',
140-
}"
139+
: 'options-list-transition'
140+
"
141141
@change="saveOptionsOrder('choice')"
142142
@start="isDragging = true"
143143
@end="isDragging = false">
@@ -167,6 +167,9 @@
167167
<OptionInputDialog
168168
v-model:open="isOptionDialogShown"
169169
@multipleAnswers="handleMultipleOptions" />
170+
<template #insert>
171+
<slot name="insert" />
172+
</template>
170173
</Question>
171174
</template>
172175

0 commit comments

Comments
 (0)