Working "tous" filter for tags

This commit is contained in:
2021-03-06 14:05:04 +01:00
parent 34e8fe9b12
commit 25a09015d1
2 changed files with 22 additions and 3 deletions

View File

@ -237,6 +237,26 @@ jQuery(document).ready(function($)
// handle tags
function handleTags()
{
$('input[name="tags"]').change(function()
{
params["tag"] = []; // remove filter
if (this.checked)
{
$('select[name="tag"] option[value=""]').prop('selected', true);
$('select[name="tag"]').attr('disabled', 'disabled');
$(".box.tags span:not(.first) select").parent().remove();
}
else
$('select[name="tag"]').removeAttr('disabled');
selectedOptions = gatherURLdata();
data = originalData;
filterData(selectedOptions);
availableOptions = [];
availableOptions = gatherData();
updateMenu(availableOptions);
});
$('.box.tags .item-cont').delegate('select[name="tag"]', 'change', function()
{
params.tag = []; // collect all tags from all dropdowns
@ -344,7 +364,7 @@ jQuery(document).ready(function($)
filterData(selectedOptions);
availableOptions = [];
availableOptions = gatherData();
updateMenu(availableOptions);
updateMenu(availableOptions);
});
$('select[name="' + name + '"]').change(function()