Hide the expand arrow if there is not enough orgs displayed
parent
1b91bc7787
commit
cee4179acd
|
@ -26,6 +26,13 @@ function selectOrgType(type) {
|
||||||
li_orgs[i].style.display = "inline-block";
|
li_orgs[i].style.display = "inline-block";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hide the 'expand' arrow if there is no need for it
|
||||||
|
if (countOrgsToDisplay(li_orgs, type) < 27) {
|
||||||
|
document.getElementsByClassName('expand')[0].style.visibility = 'hidden';
|
||||||
|
} else {
|
||||||
|
document.getElementsByClassName('expand')[0].style.visibility = 'visible';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showAllOrgs() {
|
function showAllOrgs() {
|
||||||
|
@ -35,3 +42,9 @@ function showAllOrgs() {
|
||||||
li_orgs[i].style.display = "inline-block";
|
li_orgs[i].style.display = "inline-block";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function countOrgsToDisplay(orgs, type) {
|
||||||
|
return Array.from(orgs).filter(function(element) {
|
||||||
|
return element.getAttribute('orgtype') === type;
|
||||||
|
}).length;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue