Widget:BuildDropdownFilter

Show all build types --  Optimal  Alternative  Creative  Unlabelled  Show all modes  --  All Purpose  Arena  Defense  Assault  Chain  Unlabelled  Show all investment costs  --  Low  Medium  Low and Medium  High  Very High  Show both emblem/non-emblem  --  Non-Emblem Builds  Emblem Builds // For builds page filtering var buildsToFilter = {};

document.addEventListener('DOMContentLoaded', function {   // For builds page filtering    buildsToFilter = document.getElementsByClassName("skillbuild"); }, false);

function filterBuilds { var buildTypeFilter = document.getElementById("buildTypeSelect").value; var buildModeFilter = document.getElementById("buildModeSelect").value; var buildCostFilter = document.getElementById("buildCostSelect").value; var buildEmblemFilter = document.getElementById("buildEmblemSelect").value;

hideFilteredBuilds(buildTypeFilter, buildModeFilter, buildCostFilter, buildEmblemFilter); }

function showAllBuilds { for (var i = 0; i < buildsToFilter.length; i++) { buildsToFilter[i].style.display = "inline-block"; } }

function hideFilteredBuilds(buildTypeFilter, buildModeFilter, buildCostFilter, buildEmblemFilter) { for (var i = 0; i < buildsToFilter.length; i++) { var build = buildsToFilter[i]; var buildType = buildTypeFilter && build.getAttribute("data-build-type"); var buildMode = buildModeFilter && build.getAttribute("data-build-mode"); var buildCost = buildCostFilter && build.getAttribute("data-build-cost"); var buildEmblem = buildEmblemFilter && build.getAttribute("data-build-emblem");

var showBuild = (!buildTypeFilter || buildType == buildTypeFilter) && // Build Type Filter (!buildModeFilter || buildMode == buildModeFilter) && // Build Mode Filter (!buildCostFilter || buildCost == buildCostFilter || // Build Cost Filter               (buildCostFilter == 'lowmedium' && (buildCost == 'low' || buildCost == 'medium'))) && (!buildEmblemFilter || buildEmblem == buildEmblemFilter || // Build Emblem Filter               (buildEmblemFilter == 'emblem' && buildEmblem !== '' && buildEmblem !== 'nonemblem'));

applyFilterAction(build, showBuild); } }

function applyFilterAction(element, show) { element.style.display = show ? "inline-block" : "none"; }