From 89539d59fd6689c3b8d4e807c75fd42a88433942 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Wed, 27 Nov 2024 11:50:19 +0100 Subject: [PATCH] refactor(components/Cis/Sprachen.js): refactors the Sprachen component with different styles and stores the user_langauge in the global properties of the Vue application by managing a reactive state in the phrasen plugin --- public/css/Cis4/Cis.css | 8 +++++ public/js/components/Cis/Menu.js | 44 ++++------------------------ public/js/components/Cis/Sprachen.js | 32 ++++---------------- public/js/plugin/Phrasen.js | 5 ++++ 4 files changed, 23 insertions(+), 66 deletions(-) diff --git a/public/css/Cis4/Cis.css b/public/css/Cis4/Cis.css index 82575b3a5..ca7cf7173 100644 --- a/public/css/Cis4/Cis.css +++ b/public/css/Cis4/Cis.css @@ -482,6 +482,14 @@ html { color:white !important; } +.fhc-entry.btn:focus { + box-shadow: none !important; +} + +.fhc-entry.btn { + border-radius: 0 !important; +} + .fhc-entry { transition-property: background,color; transition-duration: 0.3s,0.2s; diff --git a/public/js/components/Cis/Menu.js b/public/js/components/Cis/Menu.js index 8d5189c7f..c9ab31435 100644 --- a/public/js/components/Cis/Menu.js +++ b/public/js/components/Cis/Menu.js @@ -51,24 +51,6 @@ export default { } }, methods: { - getLanguageButtonClass(lang) { - let classString = 'btn btn-level-2 rounded-0' - const langCookie = (function(lang) { - const cookieString = document.cookie; - const cookies = cookieString.split('; '); - - for (let cookie of cookies) { - const [key, value] = cookie.split('='); - if (key === lang) { - return decodeURIComponent(value); - } - } - - return null; // Return null if the cookie is not found - })('sprache'); - if(langCookie === lang) classString += ' fhc-active'; - return classString - }, toggleCollapsibles(target){ switch(target){ case 'settings': @@ -95,20 +77,6 @@ export default { setActiveEntry(content_id){ this.activeEntry = content_id; }, - handleChangeLanguage(lang) { - this.$p.setLanguage(lang, this.$fhcApi) - const gerButton = this.$refs.ger - const engButton = this.$refs.eng - - if(lang === 'German') { - gerButton.classList.add('fhc-active') - engButton.classList.remove('fhc-active') - } else if(lang === 'English') { - engButton.classList.add('fhc-active') - gerButton.classList.remove('fhc-active') - } - - } }, mounted(){ this.entries = this.menu; @@ -135,25 +103,23 @@ export default {