fixed double active filters

This commit is contained in:
2018-10-09 15:20:17 +02:00
parent 57e47fcf33
commit 3b4e35990b
5 changed files with 15 additions and 4 deletions
+1 -1
View File
@@ -715,7 +715,7 @@ header {
font-size: 1.2em;
line-height: 1.2; }
header #menus nav ul li:not(.active) {
height: 1px;
height: 0px;
opacity: 0;
overflow: hidden;
transition: opacity 0.3s ease-in-out; }
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -83,7 +83,7 @@ header{
font-size: 1.2em;
line-height: 1.2;
&:not(.active){
height:1px; opacity:0;
height:0px; opacity:0;
overflow: hidden;
transition: opacity 0.3s ease-in-out;
}
+11
View File
@@ -78,10 +78,21 @@ var _Filters = {
// console.log('click filter btn', type);
e.preventDefault();
if(e.target.parentNode.classList.contains('active')){
// unshow active filter
e.target.parentNode.classList.remove('active');
// remove the filter
_dbs.active_type_filter = null;
}else{
// deactivate active filter if any
// a.li.ul.li.active.a.click
var prev_activelink = e.target.parentNode.parentNode.getElementsByClassName('active').item(0);//.getElementsByName('a');//.dispatchEvent('click');
if(prev_activelink){
prev_activelink.firstChild.click();
}
console.log('prev_activelink', prev_activelink);
// show the active filter
e.target.parentNode.classList.add('active');
// activate the filter
let type = e.target.getAttribute("type");
_dbs.active_type_filter = type;
}