From 7bf9f184028419f36ba63169f985eff9a0288c8c Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Tue, 18 Jan 2022 21:36:20 +0100 Subject: [PATCH] allow file uploading in recipe editor --- .../apps/RecipeEditView/RecipeEditView.vue | 64 ++++++++++++------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/vue/src/apps/RecipeEditView/RecipeEditView.vue b/vue/src/apps/RecipeEditView/RecipeEditView.vue index f2fe4b21b..9e09796ba 100644 --- a/vue/src/apps/RecipeEditView/RecipeEditView.vue +++ b/vue/src/apps/RecipeEditView/RecipeEditView.vue @@ -248,28 +248,33 @@
- - - + + + + + + + + + + +
@@ -495,6 +500,7 @@ +
@@ -556,7 +562,9 @@ - + +
@@ -592,6 +600,7 @@ VueMarkdownEditor.use(vuepressTheme, { }) import enUS from "@kangc/v-md-editor/lib/lang/en-US" +import GenericModalForm from "@/components/Modals/GenericModalForm"; VueMarkdownEditor.lang.use("en-US", enUS) @@ -602,7 +611,7 @@ Vue.use(BootstrapVue) export default { name: "RecipeEditView", mixins: [ResolveUrlMixin, ApiMixin], - components: {Multiselect, LoadingSpinner, draggable}, + components: {Multiselect, LoadingSpinner, draggable, GenericModalForm}, data() { return { recipe_id: window.RECIPE_ID, @@ -620,6 +629,9 @@ export default { recipes_loading: false, message: "", options_limit: 25, + + show_file_create: false, + step_for_file_create: undefined, } }, computed: { @@ -947,6 +959,12 @@ export default { StandardToasts.makeStandardToast(StandardToasts.FAIL_FETCH) }) }, + fileCreated: function (data) { + if (data !== 'cancel') { + this.step_for_file_create.file = data.item + } + this.show_file_create = false + }, scrollToStep: function (step_index) { document.getElementById("id_step_" + step_index).scrollIntoView({behavior: "smooth"}) },