ask for confirmation before returning or deleting items
This commit is contained in:
parent
c2e73afb35
commit
a458d4f850
1 changed files with 5 additions and 2 deletions
|
@ -53,13 +53,13 @@
|
||||||
<h6 class="card-subtitle text-secondary">uid: {{ item.uid }} box: {{ item.box }}</h6>
|
<h6 class="card-subtitle text-secondary">uid: {{ item.uid }} box: {{ item.box }}</h6>
|
||||||
<div class="row mx-auto mt-2">
|
<div class="row mx-auto mt-2">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button class="btn btn-outline-success" @click.stop="markItemReturned(item)" title="returned">
|
<button class="btn btn-outline-success" @click.stop="confirm('return Item?') && markItemReturned(item)" title="returned">
|
||||||
<font-awesome-icon icon="check"/>
|
<font-awesome-icon icon="check"/>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-outline-secondary" @click.stop="openEditingModalWith(item)" title="edit">
|
<button class="btn btn-outline-secondary" @click.stop="openEditingModalWith(item)" title="edit">
|
||||||
<font-awesome-icon icon="edit"/>
|
<font-awesome-icon icon="edit"/>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-outline-danger" @click.stop="deleteItem(item)" title="delete">
|
<button class="btn btn-outline-danger" @click.stop="confirm('delete Item?') && deleteItem(item)" title="delete">
|
||||||
<font-awesome-icon icon="trash"/>
|
<font-awesome-icon icon="trash"/>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -103,6 +103,9 @@ export default {
|
||||||
saveEditingItem() { // Saves the edited copy of the item.
|
saveEditingItem() { // Saves the edited copy of the item.
|
||||||
this.$store.dispatch('updateItem', this.editingItem);
|
this.$store.dispatch('updateItem', this.editingItem);
|
||||||
this.closeEditingModal();
|
this.closeEditingModal();
|
||||||
|
},
|
||||||
|
confirm(message) {
|
||||||
|
return window.confirm(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue