Skip to content
Snippets Groups Projects
Commit eedd011c authored by David Siegfried's avatar David Siegfried Committed by Jan-Hendrik Willms
Browse files

fixes #3914

Closes #3914

Merge request studip/studip!2813
parent 864f8004
No related branches found
No related tags found
No related merge requests found
......@@ -19,17 +19,17 @@
<button class="as-link"
:title="$gettext('Option löschen')"
@click.prevent="askForDeletingOption(index)">
<studip-icon shape="trash" role="clickable" :size="20" alt=""></studip-icon>
</button>
<button v-if="index == options.length - 1"
class="as-link"
:title="$gettext('Option hinzufügen')"
@click.prevent="addOption">
<studip-icon shape="add" role="clickable" :size="20" alt=""></studip-icon>
<studip-icon shape="trash" :role="options.length > 1 ? 'clickable' : 'inactive'" :size="20" alt=""></studip-icon>
</button>
</li>
</draggable>
<button class="as-link"
:title="$gettext('Option hinzufügen')"
@click.prevent="addOption">
<studip-icon shape="add" :size="20" alt=""></studip-icon>
</button>
<studip-dialog
v-if="askForDeleting"
:title="$gettext('Bitte bestätigen Sie die Aktion.')"
......@@ -90,6 +90,10 @@ export default {
});
},
askForDeletingOption: function (index) {
if (this.options.length <= 1) {
return;
}
this.indexOfDeletingOption = index;
if (this.value[index]) {
this.askForDeleting = true;
......@@ -175,3 +179,28 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.input-array {
display: grid;
grid-template-areas:
"sr sr"
"options button";
grid-template-columns: calc(100% - 24px) 24px;
grid-template-rows: auto;
> .sr-only {
grid-area: sr;
}
> .options {
grid-area: options;
}
> button.as-link {
align-self: end;
grid-area: button;
justify-self: left;
margin-bottom: 8px;
}
}
</style>
......@@ -56,7 +56,7 @@ export default {
if (!this.value.description) {
this.$emit('input', {
multiplechoice: 1,
options: ['', '', '', '']
options: ['', '', '', ''],
});
}
this.$refs.autofocus.focus();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment