From eee954f31f5c99baf4811237cd13acca0f12ebbb Mon Sep 17 00:00:00 2001
From: Gordon Lin <75815453+gordlin@users.noreply.github.com>
Date: Wed, 30 Oct 2024 16:45:48 -0400
Subject: [PATCH] Add config option dropdown menu
Fix
---
src/components/editor.vue | 7 +-
src/components/helpers/dropdown-menu.vue | 201 +++++++++++++++++++++++
src/components/helpers/toc-options.vue | 124 ++++++++++++++
src/components/slide-toc.vue | 161 ++++++++----------
src/lang/lang.csv | 15 +-
5 files changed, 403 insertions(+), 105 deletions(-)
create mode 100644 src/components/helpers/dropdown-menu.vue
create mode 100644 src/components/helpers/toc-options.vue
diff --git a/src/components/editor.vue b/src/components/editor.vue
index ae5b5e29..eb535481 100644
--- a/src/components/editor.vue
+++ b/src/components/editor.vue
@@ -471,8 +471,7 @@ export default class EditorV extends Vue {
if (index === -1 || !this.loadSlides) {
this.currentSlide = '';
} else {
- const selectedLang =
- (lang as keyof SlideForBothLanguages) ?? (this.configLang as keyof SlideForBothLanguages);
+ const selectedLang = (lang ?? this.configLang) as keyof SlideForBothLanguages;
const selectedSlide = this.loadSlides[index][selectedLang];
this.currentSlide = selectedSlide ?? '';
}
@@ -489,9 +488,7 @@ export default class EditorV extends Vue {
*/
updateCustomSlide(slideConfig: Slide, save?: boolean, lang?: string): void {
this.currentSlide = slideConfig;
- this.slides[this.slideIndex][
- (lang as keyof SlideForBothLanguages) ?? (this.configLang as keyof SlideForBothLanguages)
- ] = slideConfig;
+ this.slides[this.slideIndex][(lang ?? this.configLang) as keyof SlideForBothLanguages] = slideConfig;
// save changes emitted from advanced editor
if (save) {
this.$emit('save-changes');
diff --git a/src/components/helpers/dropdown-menu.vue b/src/components/helpers/dropdown-menu.vue
new file mode 100644
index 00000000..b41e1dc2
--- /dev/null
+++ b/src/components/helpers/dropdown-menu.vue
@@ -0,0 +1,201 @@
+
+