From c3f21ce914983e54d119abac7730985a3a60ff85 Mon Sep 17 00:00:00 2001 From: Yi Lei Feng Date: Thu, 21 Mar 2024 11:25:12 -0400 Subject: [PATCH] fix saving for right panels and unsaved alert not appearing --- src/components/editor/dynamic-editor.vue | 1 + src/components/editor/editor.vue | 5 ++--- src/components/editor/image-editor.vue | 2 +- src/components/editor/slide-editor.vue | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/editor/dynamic-editor.vue b/src/components/editor/dynamic-editor.vue index afb31877..d3ec7481 100644 --- a/src/components/editor/dynamic-editor.vue +++ b/src/components/editor/dynamic-editor.vue @@ -81,6 +81,7 @@ :configFileStructure="configFileStructure" :lang="lang" :sourceCounts="sourceCounts" + @slide-edit="$emit('slide-edit')" > diff --git a/src/components/editor/editor.vue b/src/components/editor/editor.vue index 07f05409..0865a0d0 100644 --- a/src/components/editor/editor.vue +++ b/src/components/editor/editor.vue @@ -262,11 +262,10 @@ export default class EditorV extends Vue { if (this.$refs.slide !== undefined) { this.$nextTick(() => { (this.$refs.slide as SlideEditorV).saveChanges(); + // emit save changes event + this.$emit('save-changes'); }); } - - // emit save changes event - this.$emit('save-changes'); } beforeWindowUnload(e: BeforeUnloadEvent): void { diff --git a/src/components/editor/image-editor.vue b/src/components/editor/image-editor.vue index 36bd2494..09c9159e 100644 --- a/src/components/editor/image-editor.vue +++ b/src/components/editor/image-editor.vue @@ -25,7 +25,7 @@ {{ $t('editor.image.label.upload') }} - + diff --git a/src/components/editor/slide-editor.vue b/src/components/editor/slide-editor.vue index 67972de4..b47718f1 100644 --- a/src/components/editor/slide-editor.vue +++ b/src/components/editor/slide-editor.vue @@ -212,6 +212,7 @@ :lang="lang" :uid="uid" :sourceCounts="sourceCounts" + @slide-edit="$emit('slide-edit')" >