mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Also filter gallery items when searching for recipes (references #147)
This commit is contained in:
parent
3a1c5efcfd
commit
7f2942d414
@ -64,3 +64,11 @@ GetFileExtension = function(pathOrFileName)
|
||||
{
|
||||
return pathOrFileName.split(".").pop();
|
||||
}
|
||||
|
||||
$.extend($.expr[":"],
|
||||
{
|
||||
"contains_case_insensitive": function(elem, i, match, array)
|
||||
{
|
||||
return (elem.textContent || elem.innerText || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0;
|
||||
}
|
||||
});
|
||||
|
@ -52,12 +52,11 @@ $("a[data-toggle='tab']").on("shown.bs.tab", function(e)
|
||||
$("#search").on("keyup", function()
|
||||
{
|
||||
var value = $(this).val();
|
||||
if (value === "all")
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
|
||||
recipesTables.search(value).draw();
|
||||
|
||||
$(".recipe-gallery-item-container").removeClass("d-none");
|
||||
$(".recipe-gallery-item-container .card-title:not(:contains_case_insensitive(" + value + "))").parent().parent().parent().parent().addClass("d-none");
|
||||
});
|
||||
|
||||
$("#selectedRecipeDeleteButton").on('click', function(e)
|
||||
|
@ -64,9 +64,9 @@
|
||||
<div class="tab-pane show" id="gallery">
|
||||
<div class="row no-gutters">
|
||||
@foreach($recipes as $recipe)
|
||||
<div class="col-6">
|
||||
<div class="col-6 recipe-gallery-item-container">
|
||||
<a class="discrete-link recipe-gallery-item" data-recipe-id="{{ $recipe->id }}" href="#">
|
||||
<div id="recipe-card-{{ $recipe->id }}" class="card border-white mb-0">
|
||||
<div id="recipe-card-{{ $recipe->id }}" class="card border-white mb-0 recipe-card">
|
||||
@if(!empty($recipe->picture_file_name))
|
||||
<img src="{{ $U('/api/files/recipepictures/' . base64_encode($recipe->picture_file_name)) }}" class="img-fluid">
|
||||
@endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user