Skip to content
Snippets Groups Projects
Commit 2b322104 authored by Timothee P's avatar Timothee P :sunflower: Committed by Sébastien DA ROCHA
Browse files

REDMINE_ISSUE-14462|Bouton filtres mal placé et flêche inconsistante

parent edab018f
No related branches found
No related tags found
No related merge requests found
<template> <template>
<div class="filters-container"> <div id="filters-container">
<div class="ui styled accordion"> <div
class="ui styled accordion"
@click="displayFilters = !displayFilters"
>
<div <div
id="filters" id="filters"
class="title collapsible-filters" class="title collapsible-filters"
> >
FILTRES FILTRES
<i <i
class="ui icon caret right down" :class="['ui icon customcaret', { 'collapsed': !displayFilters }]"
aria-hidden="true" aria-hidden="true"
/> />
</div> </div>
</div> </div>
<div class="ui menu filters hidden"> <div :class="['ui menu filters', { 'hidden': displayFilters }]">
<div class="item"> <div class="item">
<label> <label>
Niveau d'autorisation requis Niveau d'autorisation requis
...@@ -40,7 +43,7 @@ ...@@ -40,7 +43,7 @@
v-on="$listeners" v-on="$listeners"
/> />
</div> </div>
<div class="right item"> <div class="item">
<label> <label>
Recherche par nom Recherche par nom
</label> </label>
...@@ -69,6 +72,7 @@ export default { ...@@ -69,6 +72,7 @@ export default {
data() { data() {
return { return {
displayFilters: false,
moderationOptions: [ moderationOptions: [
{ {
label: 'Tous', label: 'Tous',
...@@ -157,42 +161,10 @@ export default { ...@@ -157,42 +161,10 @@ export default {
} }
}, },
mounted() {
const el = document.getElementsByClassName('collapsible-filters');
el[0].addEventListener('click', function() {
const icon = document.getElementsByClassName('caret');
icon[0].classList.toggle('right');
const content = document.getElementsByClassName('filters');
content[0].classList.toggle('hidden');
if (content[0].style.maxHeight){
content[0].style.maxHeight = null;
} else {
content[0].style.maxHeight = content[0].scrollHeight + 5 + 'px';
}
});
window.addEventListener('resize', this.handleResize);
},
methods: { methods: {
...mapActions('projects', [ ...mapActions('projects', [
'SEARCH_PROJECTS' 'SEARCH_PROJECTS'
]), ]),
handleResize() {
if (window.innerWidth <= 700) {
const icon = document.getElementsByClassName('caret');
icon[0].classList.toggle('right');
const content = document.getElementsByClassName('filters');
content[0].classList.toggle('hidden');
if (content[0].style.maxHeight){
content[0].style.maxHeight = null;
} else {
content[0].style.maxHeight = content[0].scrollHeight + 5 + 'px';
}
}
}
} }
}; };
</script> </script>
...@@ -205,18 +177,34 @@ export default { ...@@ -205,18 +177,34 @@ export default {
transition: @arguments; transition: @arguments;
} }
.filters-container { #filters-container {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: flex-end;
margin-bottom: 1rem;
.accordion { .accordion {
width: fit-content !important; width: fit-content;
.collapsible-filters { .collapsible-filters {
font-size: 1.25em; font-size: 1.25em;
padding-right: 0; padding-right: 0;
.customcaret{
transition: transform .2s ease;
&.collapsed {
transform: rotate(180deg);
}
&::before{
position: relative;
right: 0;
top: 65%;
color: #999;
margin-top: 4px;
border-color: #999 transparent transparent;
border-style: solid;
border-width: 5px 5px 0;
content: "";
}
}
} }
} }
.filters { .filters {
...@@ -224,16 +212,16 @@ export default { ...@@ -224,16 +212,16 @@ export default {
height:auto; height:auto;
min-height: 0; min-height: 0;
max-height:75px; max-height:75px;
opacity: 1;
margin: 0 0 1em 0; margin: 0 0 1em 0;
border: none; border: none;
box-shadow: none; box-shadow: none;
.transition-properties(max-height 0.2s ease-out;); .transition-properties(all 0.2s ease-out;);
.item { .item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start !important; align-items: flex-start !important;
padding: 0.5em;
padding: 0.4em 0.6em 0.4em 0;
label { label {
margin-bottom: 0.2em; margin-bottom: 0.2em;
...@@ -247,33 +235,41 @@ export default { ...@@ -247,33 +235,41 @@ export default {
.item::before { .item::before {
width: 0; width: 0;
} }
.right.item { #search-projects {
padding-right: 0; width: 100%;
#search-projects {
width: 100%;
}
} }
.right.item::before {
width: 0;
}
} }
.filters.hidden { .filters.hidden {
max-height: 0;
overflow: hidden; overflow: hidden;
border: none; opacity: 0;
max-height: 0;
} }
} }
@media screen and (min-width: 701px) {
.item {
&:first-child {
padding-left: 0;
}
&:last-child {
padding-right: 0;
}
}
}
@media screen and (max-width: 700px) { @media screen and (max-width: 700px) {
.filters-container { #filters-container {
.filters { .filters {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.transition-properties(max-height 0.2s ease-out;); max-height: 275px;
.transition-properties(all 0.2s ease-out;);
.item { .item {
width: 100%; width: 100%;
padding-right: 0;
padding-left: 0;
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment