fix map nav responsive #2221

This commit is contained in:
Bachir Soussi Chiadmi 2023-10-10 11:31:35 +02:00
parent 69b0d79591
commit 6f5062b774
3 changed files with 36 additions and 12 deletions

View File

@ -124,12 +124,36 @@ body{
align-items: center; align-items: center;
} }
}
}
}
@media screen and (max-width: 1300px) { @media screen and (max-width: 1300px) {
ul{
gap: 0.5em;
li{
margin:0;
a{
span.label{ span.label{
display: none; display: none;
} }
span.icon {
width:2em;
height:2em;
border-radius: 1em;
}
}
}
}
}
@media screen and (max-width: 880px) {
ul{
flex-flow: column;
width:fit-content;
margin: 0;
li{
a{
span.icon{}
} }
} }
} }

View File

@ -15,7 +15,7 @@ import ResultsEntiteFields from '@api/gql/results_entite.fragment.gql'
export const SearchStore = defineStore({ export const SearchStore = defineStore({
id: 'search', id: 'search',
state: () => ({ state: () => ({
keys: [], phrase: null,
contentTypeFilter: 'concernements', contentTypeFilter: 'concernements',
results: null, results: null,
loaded_results: null loaded_results: null
@ -24,10 +24,10 @@ export const SearchStore = defineStore({
}, },
actions: { actions: {
setKeys (value) { setSearchValue (value) {
console.log('setKeys', value); console.log('setSearchValue', value);
if (value) { if (value) {
this.keys = value.split(' '); this.phrase = value;
} }
}, },
setContentType (v) { setContentType (v) {
@ -37,7 +37,7 @@ export const SearchStore = defineStore({
console.log('search store loadResults', this.keys); console.log('search store loadResults', this.keys);
// this.keys = keys; // this.keys = keys;
const params = { const params = {
keys: this.keys.join(', '), phrase: this.phrase,
content_type: this.contentTypeFilter content_type: this.contentTypeFilter
} }
const q = qs.stringify(params) const q = qs.stringify(params)

View File

@ -16,7 +16,7 @@ export default {
} }
}, },
computed: { computed: {
...mapState(SearchStore,['keys', 'contentTypeFilter', 'results', 'loaded_results']), ...mapState(SearchStore,['phrase', 'contentTypeFilter', 'results', 'loaded_results']),
...mapState(ConcernementsStore,['map_mode', 'opened_concernement']), ...mapState(ConcernementsStore,['map_mode', 'opened_concernement']),
// value(){ // value(){
// return this.keys // return this.keys
@ -24,13 +24,13 @@ export default {
}, },
created () { created () {
console.log("search created"); console.log("search created");
this.value = this.keys.join(' '); this.value = this.phrase;
this.content_type = this.contentTypeFilter; this.content_type = this.contentTypeFilter;
}, },
watch: { watch: {
value: { value: {
handler (n,o){ handler (n,o){
this.setKeys(n); this.setSearchValue(n);
}, },
deep: true deep: true
}, },
@ -42,7 +42,7 @@ export default {
}, },
}, },
methods: { methods: {
...mapActions(SearchStore,['setKeys','setContentType','newSearch']), ...mapActions(SearchStore,['setSearchValue','setContentType','newSearch']),
...mapActions(ConcernementsStore,['openCloseConcernements']), ...mapActions(ConcernementsStore,['openCloseConcernements']),
onSubmitSearch (event) { onSubmitSearch (event) {
console.log("onSubmitSearch", event, this.value); console.log("onSubmitSearch", event, this.value);