From 5f2320a3e7eed98695ac6ae6861da058729838d8 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sun, 5 Jul 2020 22:36:39 +0200 Subject: [PATCH] added save confirm --- cookbook/templates/forms/edit_internal_recipe.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cookbook/templates/forms/edit_internal_recipe.html b/cookbook/templates/forms/edit_internal_recipe.html index e2db62ee2..956b10ec8 100644 --- a/cookbook/templates/forms/edit_internal_recipe.html +++ b/cookbook/templates/forms/edit_internal_recipe.html @@ -408,7 +408,7 @@ el: '#id_base_container', data: { recipe: undefined, - recipe_changed: false, + recipe_changed: undefined, keywords: [], keywords_loading: false, foods: [], @@ -428,9 +428,9 @@ recipe: { deep: true, handler() { - if (!this.loading) { - - console.log('CHANGED') + if (this.recipe_changed === undefined) { + this.recipe_changed = false + } else { this.recipe_changed = true } } @@ -456,7 +456,6 @@ this.$http.get("{% url 'api:recipe-detail' recipe.pk %}").then((response) => { this.recipe = response.data; this.loading = false - this.recipe_changed = false }).catch((err) => { this.loading = false console.log(err)