From 92f00f41c645b4437726acbe609705ad8744b737 Mon Sep 17 00:00:00 2001 From: zackbcom Date: Mon, 4 Jan 2021 23:10:14 -0600 Subject: [PATCH 1/4] Adding in Confirmation logic. --- frontend/src/components/UI/ButtonRow.vue | 17 ++++- frontend/src/components/UI/Confirmation.vue | 72 +++++++++++++++------ 2 files changed, 69 insertions(+), 20 deletions(-) diff --git a/frontend/src/components/UI/ButtonRow.vue b/frontend/src/components/UI/ButtonRow.vue index aec3c8cb8490..1a5a6d539c21 100644 --- a/frontend/src/components/UI/ButtonRow.vue +++ b/frontend/src/components/UI/ButtonRow.vue @@ -5,7 +5,9 @@
mdi-delete + + mdi-content-save @@ -27,6 +29,9 @@ export default { default: true, }, }, + components: { + Confirmation: () => import("../UI/Confirmation"), + }, methods: { editor() { this.$emit("editor"); @@ -34,8 +39,16 @@ export default { save() { this.$emit("save"); }, - deleteRecipe() { - this.$emit("delete"); + async deleteRecipe() { + if ( + await this.$refs.confirm.open( + "Delete Recpie", + "Are you sure you want to delete this recipie?", + { color: "error", icon: "mdi-alert-circle" } + ) + ) { + this.$emit("delete"); + } }, json() { this.$emit("json"); diff --git a/frontend/src/components/UI/Confirmation.vue b/frontend/src/components/UI/Confirmation.vue index 0437e3561a61..46fe6ae70d85 100644 --- a/frontend/src/components/UI/Confirmation.vue +++ b/frontend/src/components/UI/Confirmation.vue @@ -1,14 +1,27 @@