Update on filter

This commit is contained in:
2021-02-22 13:33:19 +01:00
parent 4739726e5c
commit fece1eab16
3 changed files with 34 additions and 16 deletions

View File

@ -109,26 +109,34 @@ function updateMenu(availableOptions)
{
console.log("updateMenu", availableOptions);
$('.photos input, .photos input + label').each(function()
function checkItem(name, array)
{
if (this.value != "all")
$(this).css('color', 'red');
$('.'+name+' .item-cont span').each(function()
{
$(this).addClass("filter");
});
for (a of array)
{
$('.'+name+' .item-cont span input[id="'+a+'"]').parent().removeClass("filter");
}
}
checkItem("photos", availableOptions.photos);
checkItem("years", availableOptions.years);
checkItem("months", availableOptions.months);
checkItem("genres", availableOptions.genres);
checkItem("themes", availableOptions.themes);
checkItem("dimensions", availableOptions.dimensions);
checkItem("help", availableOptions.helps);
/*$('.photos .item-cont span').each(function()
{
$(this).addClass("filter");
});
for (a of availableOptions.photos)
{
$('.photos input[id="' + a + '"], .photos input[id="' + a + '"] + label').css('color', 'black');
}
/*$('.photos input').each(function()
{
console.log(this.id);
for (i of availableOptions.photos)
{
console.log("fuck", this.id, i);
if (this.id != i)
$(this).hide();
}
});*/
$('.photos .item-cont span input[id="'+a+'"]').parent().removeClass("filter");
}*/
}
function URLGeneration(availableOptions)