Mobile setup for "explorer" page on configurer

This commit is contained in:
2021-01-30 13:39:18 +01:00
parent 093d451f16
commit b838e78ec4
4 changed files with 524 additions and 109 deletions

View File

@ -59,31 +59,31 @@ jQuery(document).ready(function($)
{
html = '<span><input type="checkbox" id="' + dimension + '" name="dimension" value="' + dimension + '"></input>\n';
html += '<label for="' + dimension + '">' + dimension + '</label></span>';
$(".box.dimensions").append(html);
$(".box.dimensions .item-cont").append(html);
}
for (theme of themes)
{
html = '<span><input type="checkbox" id="' + theme + '" name="theme" value="' + theme + '"></input>\n';
html += '<label for="' + theme + '">' + theme + '</label></span>';
$(".box.themes").append(html);
$(".box.themes .item-cont").append(html);
}
for (category of categories)
{
html = '<span><input type="checkbox" id="' + category + '" name="category" value="' + category + '"></input>\n';
html += '<label for="' + category + '">' + category + '</label></span>';
$(".box.categories").append(html);
$(".box.categories .item-cont").append(html);
}
for (place of places)
{
html = '<span><input type="checkbox" id="' + place + '" name="place" value="' + place + '"></input>\n';
html += '<label for="'+place+'">' + place + '</label></span>';
$(".box.places").append(html);
$(".box.places .item-cont").append(html);
}
for (tag of tags)
{
html = '<span><input type="checkbox" id="' + tag + '" name="tag" value="' + tag + '"></input>\n';
html += '<label for="'+tag+'">' + tag + '</label></span>';
$(".box.tags").append(html);
$(".box.tags .item-cont").append(html);
}
// populate checkboxes depending on URL
@ -160,6 +160,24 @@ jQuery(document).ready(function($)
}
});
// menu configurer child on mobile show/hide
if ($(window).width() <= 600)
{
$("article.explorer .box h3").click(function()
{
if ($(this).parent().hasClass("active"))
{
$(this).parent().removeClass("active");
$(this).parent().children(".item-cont").slideUp(200);
}
else
{
$(this).parent().addClass("active");
$(this).parent().children(".item-cont").slideDown(200);
}
});
}
/***********/
/** TABLE **/
@ -341,5 +359,19 @@ jQuery(document).ready(function($)
}
else
$("article.explorer p.no-result").css("display", "block");
// on mobile, show only the first item slided down
if ($(window).width() <= 600)
{
console.log($(window).width());
$("article.explorer .container .box").each(function()
{
console.log("hi");
if (!$(this).hasClass('active'))
{
$(this).children(".item-cont").slideUp(200);
}
});
}
});
});