Working "tous" filter for tags
This commit is contained in:
parent
34e8fe9b12
commit
25a09015d1
@ -109,8 +109,7 @@
|
||||
<div class="item-cont">
|
||||
<span><input type="checkbox" id="tags" name="tags" value="all">
|
||||
<label for="tags">Tous</label></span>
|
||||
<span><span class="inline">※ </span><select name="tag"></select></span>
|
||||
<div class="generated"></div>
|
||||
<span class="first"><span class="inline">※ </span><select name="tag"></select></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box dimensions">
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user