From 6f927797d821c3e46005f203612f168e5d6522fc Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Fri, 22 Oct 2021 00:30:43 +0100 Subject: [PATCH] :sparkles: Adds an option to enable edit mode, in settings --- src/components/Settings/ConfigLauncher.vue | 42 ++++++++++++---------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/src/components/Settings/ConfigLauncher.vue b/src/components/Settings/ConfigLauncher.vue index 18c227b2..da90aed2 100644 --- a/src/components/Settings/ConfigLauncher.vue +++ b/src/components/Settings/ConfigLauncher.vue @@ -5,7 +5,10 @@
- +
@@ -50,6 +53,7 @@ import LanguageSwitcher from '@/components/Settings/LanguageSwitcher'; import { topLevelConfKeys, localStorageKeys, modalNames } from '@/utils/defaults'; import Keys from '@/utils/StoreMutations'; import IconSpanner from '@/assets/interface-icons/config-editor.svg'; +import IconInteractiveEditor from '@/assets/interface-icons/interactive-editor-start-editing.svg'; import IconViewMode from '@/assets/interface-icons/application-change-view.svg'; import IconHome from '@/assets/interface-icons/application-home.svg'; import IconWorkspaceView from '@/assets/interface-icons/open-workspace.svg'; @@ -67,6 +71,7 @@ export default { ConfigContainer, LanguageSwitcher, IconSpanner, + IconInteractiveEditor, IconViewMode, IconHome, IconWorkspaceView, @@ -82,6 +87,15 @@ export default { pageInfo() { return this.$store.getters.pageInfo; }, + isEditMode() { + return this.$store.state.editMode; + }, + enterEditModeTooltip() { + // Change tooltip text for 'Enter Edit Mode' button, when already in Edit Mode + return this.$t( + `interactive-editor.${this.isEditMode ? 'edit-mode-subtitle' : 'start-editing-tooltip'}`, + ); + }, }, methods: { showEditor: function show() { @@ -109,34 +123,24 @@ export default { closeViewSwitcher() { this.viewSwitcherOpen = false; }, + startInteractiveEditor() { + if (!this.isEditMode) { + this.$store.commit(Keys.SET_EDIT_MODE, true); + } + }, }, };