From 1d263033335bcbfbe31ded13c6518840e16aae51 Mon Sep 17 00:00:00 2001 From: adisposkofh Date: Fri, 17 Apr 2026 15:59:32 +0200 Subject: [PATCH] fixed mobile header/searchbar appearance --- public/js/apps/Cis.js | 12 + public/js/apps/Dashboard/Fhc.js | 8 - public/js/components/Cis/Menu.js | 28 +- public/js/components/searchbar/searchbar.js | 540 +++++++++++--------- 4 files changed, 330 insertions(+), 258 deletions(-) diff --git a/public/js/apps/Cis.js b/public/js/apps/Cis.js index c88a47a35..39fde01a2 100644 --- a/public/js/apps/Cis.js +++ b/public/js/apps/Cis.js @@ -136,6 +136,18 @@ const app = Vue.createApp({ } }; }, + computed: { + isMobile() { + const smallScreen = window.matchMedia("(max-width: 767px)").matches; + const touchCapable = ("ontouchstart" in window) || navigator.maxTouchPoints > 0; + return smallScreen;// && touchCapable; + }, + }, + provide() { + return { + isMobile: this.isMobile + } + }, methods: { searchfunction: function(searchsettings) { return this.$api.call(ApiSearchbar.searchCis(searchsettings)); diff --git a/public/js/apps/Dashboard/Fhc.js b/public/js/apps/Dashboard/Fhc.js index 140c76402..7b7d91fb7 100644 --- a/public/js/apps/Dashboard/Fhc.js +++ b/public/js/apps/Dashboard/Fhc.js @@ -233,18 +233,10 @@ const app = Vue.createApp({ renderers: null, }), components: {}, - computed: { - isMobile() { - const smallScreen = window.matchMedia("(max-width: 767px)").matches; - const touchCapable = ("ontouchstart" in window) || navigator.maxTouchPoints > 0; - return smallScreen;// && touchCapable; - } - }, provide() { return { // provide injectable & watchable language property language: Vue.computed(() => this.$p.user_language), renderers: Vue.computed(() => this.renderers), - isMobile: this.isMobile } }, methods: { diff --git a/public/js/components/Cis/Menu.js b/public/js/components/Cis/Menu.js index f073d5a38..f2f73de26 100644 --- a/public/js/components/Cis/Menu.js +++ b/public/js/components/Cis/Menu.js @@ -28,8 +28,10 @@ export default { urlMatchRankings:[], navUserDropdown:null, menuOpen:true, + isSearchShownInMobileView: false, }; }, + inject: ["isMobile"], provide(){ return{ setActiveEntry: this.setActiveEntry, @@ -58,7 +60,10 @@ export default { }, site_url(){ return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router; - } + }, + areHeaderOptionsShown() { + return !this.isSearchShownInMobileView || !this.isMobile; + }, }, methods: { fetchMenu() { @@ -112,10 +117,21 @@ export default { }); }, template: /*html*/` - - + + + + + -