Working "tous" filter for places
This commit is contained in:
parent
4effbe657e
commit
34e8fe9b12
@ -284,11 +284,7 @@ jQuery(document).ready(function($)
|
||||
{
|
||||
$('input[name="' + name + 's"]').change(function()
|
||||
{
|
||||
// set back array with original available
|
||||
if (this.checked)
|
||||
params[name] = originalAvailableOptions[name + "s"];
|
||||
else
|
||||
params[name] = []
|
||||
params[name] = []; // remove filter
|
||||
|
||||
selectedOptions = gatherURLdata();
|
||||
data = originalData;
|
||||
@ -330,14 +326,33 @@ jQuery(document).ready(function($)
|
||||
});
|
||||
}
|
||||
|
||||
function visualFilterListItem(name, param)
|
||||
function visualFilterListItem(name)
|
||||
{
|
||||
$('input[name="' + name + 's"]').change(function()
|
||||
{
|
||||
params[name] = []; // remove filter
|
||||
if (this.checked)
|
||||
{
|
||||
$('select[name="' + name + '"] option[value=""]').prop('selected', true);
|
||||
$('select[name="' + name + '"]').attr('disabled', 'disabled');
|
||||
}
|
||||
else
|
||||
$('select[name="' + name + '"]').removeAttr('disabled');
|
||||
|
||||
selectedOptions = gatherURLdata();
|
||||
data = originalData;
|
||||
filterData(selectedOptions);
|
||||
availableOptions = [];
|
||||
availableOptions = gatherData();
|
||||
updateMenu(availableOptions);
|
||||
});
|
||||
|
||||
$('select[name="' + name + '"]').change(function()
|
||||
{
|
||||
if (this.value == "" && name == "place")
|
||||
param.pop();
|
||||
params[name].pop();
|
||||
else
|
||||
param.push(this.value);
|
||||
params[name].push(this.value);
|
||||
|
||||
selectedOptions = gatherURLdata();
|
||||
data = originalData;
|
||||
@ -355,7 +370,8 @@ jQuery(document).ready(function($)
|
||||
visualFilterCheckboxItem("theme");
|
||||
visualFilterCheckboxItem("dimension");
|
||||
visualFilterCheckboxItem("help");
|
||||
visualFilterListItem("place", paramPlace);
|
||||
|
||||
visualFilterListItem("place");
|
||||
});
|
||||
|
||||
/*********************/
|
||||
|
Loading…
Reference in New Issue
Block a user