Update on filter

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

View File

@ -288,6 +288,11 @@ jQuery(document).ready(function($)
visualFilterListItem("photo", paramPhoto);
visualFilterListItem("year", paramYear);
visualFilterListItem("month", paramMonth);
visualFilterListItem("genre", paramGenre);
visualFilterListItem("theme", paramTheme);
visualFilterListItem("dimension", paramDimension);
visualFilterListItem("help", paramHelp);
});

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)

View File

@ -542,6 +542,11 @@ input:checked + label {
font-weight:bold;
}
.item-cont span.filter {
font-size:0.75rem;
/*text-decoration:line-through;*/
}
@media only screen and (max-width:600px) {
article.explorer form .container {
display:block;