Skip to content
Snippets Groups Projects
Commit 4ec40331 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

add button delete option & add and delete function

parent 3efcde4d
No related branches found
No related tags found
1 merge request!587REDMINE_ISSUE-17413 | Nouveau formulaire de création des listes de valeurs
......@@ -180,7 +180,7 @@
class="draggable-row"
>
<i
class="th icon"
class="th icon grey"
aria-hidden="true"
/>
<input
......@@ -191,6 +191,10 @@
class="options-field"
@change="updateOptionValue(index, $event)"
>
<i
class="trash icon grey"
@click="deleteOption(index)"
></i>
</div>
</div>
<div class="ui buttons">
......@@ -430,7 +434,7 @@ export default {
this.form.options.value = currentOptionsList;
this.updateStore();
},
initSortable() {
this.sortable = new Sortable(document.getElementById(`list-options-${this.customForm.dataKey}`), {
animation: 150,
......@@ -440,9 +444,13 @@ export default {
onEnd: this.updateOptionOrder,
});
},
addOption() {
console.log('addOption');
this.form.options.value.push('');
},
deleteOption(index) {
this.form.options.value.splice(index, 1);
},
updateStore() {
......@@ -553,7 +561,9 @@ export default {
align-items: baseline;
margin-bottom: 1em;
input {
margin-left: .5em !important;
margin: 0 .5em !important;
}
i.icon.trash {
}
}
</style>
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