Fix issue with "exist" in photos that was not filtering
This commit is contained in:
parent
5b79f924cb
commit
44a5f52e94
@ -213,13 +213,6 @@ jQuery(document).ready(function($)
|
|||||||
if (p == "90") for (i = 90; i <= 99; i++) selectedDimensions.push(i);
|
if (p == "90") for (i = 90; i <= 99; i++) selectedDimensions.push(i);
|
||||||
if (p == "100") for (i = 100; i <= 109; i++) selectedDimensions.push(i);
|
if (p == "100") for (i = 100; i <= 109; i++) selectedDimensions.push(i);
|
||||||
}
|
}
|
||||||
// special case of a multi selector
|
|
||||||
if (selectedPhotos.includes("exist"))
|
|
||||||
{
|
|
||||||
selectedPhotos.push("bad");
|
|
||||||
selectedPhotos.push("ok");
|
|
||||||
selectedPhotos.push("good");
|
|
||||||
}
|
|
||||||
return {"photos": selectedPhotos, "years": selectedYears, "months": selectedMonths, "genres": selectedGenres, "themes": selectedThemes,
|
return {"photos": selectedPhotos, "years": selectedYears, "months": selectedMonths, "genres": selectedGenres, "themes": selectedThemes,
|
||||||
"places": selectedPlaces, "tags": selectedTags, "dimensions": selectedDimensions, "helps": selectedHelps};
|
"places": selectedPlaces, "tags": selectedTags, "dimensions": selectedDimensions, "helps": selectedHelps};
|
||||||
}
|
}
|
||||||
@ -291,9 +284,25 @@ jQuery(document).ready(function($)
|
|||||||
$('input[name="' + name + '"]').change(function()
|
$('input[name="' + name + '"]').change(function()
|
||||||
{
|
{
|
||||||
if (this.checked)
|
if (this.checked)
|
||||||
|
{
|
||||||
|
if (this.id == "exist") // photos special case
|
||||||
|
{
|
||||||
|
param.push("bad");
|
||||||
|
param.push("ok");
|
||||||
|
param.push("good");
|
||||||
|
}
|
||||||
param.push(this.id);
|
param.push(this.id);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (this.id == "exist") // photos special case
|
||||||
|
{
|
||||||
|
removeFromArray(param, "bad");
|
||||||
|
removeFromArray(param, "ok");
|
||||||
|
removeFromArray(param, "good");
|
||||||
|
}
|
||||||
removeFromArray(param, this.id);
|
removeFromArray(param, this.id);
|
||||||
|
}
|
||||||
|
|
||||||
selectedOptions = gatherURLdata();
|
selectedOptions = gatherURLdata();
|
||||||
data = originalData;
|
data = originalData;
|
||||||
|
@ -96,11 +96,11 @@ function generateMenu(availableOptions)
|
|||||||
$(".box.help .item-cont .generated").append(html);
|
$(".box.help .item-cont .generated").append(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(".box.places select").append('<option value="">Aucun</option');
|
$(".box.places select").append('<option value="">Aucun filtre</option');
|
||||||
for (place of availableOptions.places)
|
for (place of availableOptions.places)
|
||||||
$(".box.places select").append('<option value="' + place + '">' + place + '</option');
|
$(".box.places select").append('<option value="' + place + '">' + place + '</option');
|
||||||
|
|
||||||
$(".box.tags select").append('<option value="">Aucun</option');
|
$(".box.tags select").append('<option value="">Aucun filtre</option');
|
||||||
for (tag of availableOptions.tags)
|
for (tag of availableOptions.tags)
|
||||||
$(".box.tags select").append('<option value="' + tag + '">' + tag + '</option');
|
$(".box.tags select").append('<option value="' + tag + '">' + tag + '</option');
|
||||||
}
|
}
|
||||||
@ -119,14 +119,7 @@ function updateMenu(availableOptions)
|
|||||||
|
|
||||||
// special case for "exist" in photos
|
// special case for "exist" in photos
|
||||||
if ($(this).prop("value") == "exist")
|
if ($(this).prop("value") == "exist")
|
||||||
{
|
|
||||||
if (array.includes("none") && ! (array.includes("bad") || array.includes("ok") || array.includes("good")))
|
|
||||||
$(this).parent().addClass("filter");
|
|
||||||
else
|
|
||||||
$(this).parent().removeClass("filter");
|
$(this).parent().removeClass("filter");
|
||||||
if (array.length == 0)
|
|
||||||
$(this).parent().addClass("filter");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$(this).parent().removeClass("filter");
|
$(this).parent().removeClass("filter");
|
||||||
@ -188,7 +181,7 @@ function URLGeneration(availableOptions)
|
|||||||
for (a of param)
|
for (a of param)
|
||||||
{
|
{
|
||||||
html = '<span><span class="inline">※ </span><select name="' + name + '">';
|
html = '<span><span class="inline">※ </span><select name="' + name + '">';
|
||||||
html += '<option value="">Aucun</option>';
|
html += '<option value="">Aucun filtre</option>';
|
||||||
for (i of names)
|
for (i of names)
|
||||||
{
|
{
|
||||||
if (i == a)
|
if (i == a)
|
||||||
@ -202,7 +195,7 @@ function URLGeneration(availableOptions)
|
|||||||
if (!param.includes("all") && param.length >= 1 && name != "place")
|
if (!param.includes("all") && param.length >= 1 && name != "place")
|
||||||
{
|
{
|
||||||
html = '<span><span class="inline">※ </span><select name="' + name + '">';
|
html = '<span><span class="inline">※ </span><select name="' + name + '">';
|
||||||
html += '<option value="">Aucun</option>';
|
html += '<option value="">Aucun filtre</option>';
|
||||||
for (i of names)
|
for (i of names)
|
||||||
html += '<option value="' + i + '">' + i + '</option>';
|
html += '<option value="' + i + '">' + i + '</option>';
|
||||||
html += '</select></span>';
|
html += '</select></span>';
|
||||||
|
Loading…
Reference in New Issue
Block a user