mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
display productCard when clicking item on shopping list (#1078)
This commit is contained in:
parent
438cc08b98
commit
57aa6499eb
@ -141,6 +141,15 @@ $(document).on('click', '.shoppinglist-delete-button', function(e)
|
||||
);
|
||||
});
|
||||
|
||||
$(document).on("click", ".product-name-cell", function(e)
|
||||
{
|
||||
if ($(e.currentTarget).attr("data-product-id") != "")
|
||||
{
|
||||
Grocy.Components.ProductCard.Refresh($(e.currentTarget).attr("data-product-id"));
|
||||
$("#shoppinglist-productcard-modal").modal("show");
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '#add-products-below-min-stock-amount', function(e)
|
||||
{
|
||||
Grocy.Api.Post('stock/shoppinglist/add-missing-products', { "list_id": $("#selected-shopping-list").val() },
|
||||
|
@ -195,7 +195,8 @@
|
||||
<i class="fas fa-box"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<td class="product-name-cell cursor-link"
|
||||
data-product-id="{{ $listItem->product_id }}">
|
||||
@if(!empty($listItem->product_id)) {{ FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->name }}<br>@endif<em>{!! nl2br($listItem->note) !!}</em>
|
||||
</td>
|
||||
<td>
|
||||
@ -326,4 +327,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade"
|
||||
id="shoppinglist-productcard-modal"
|
||||
tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content text-center">
|
||||
<div class="modal-body">
|
||||
@include('components.productcard')
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button"
|
||||
class="btn btn-secondary"
|
||||
data-dismiss="modal">{{ $__t('Close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
Loading…
x
Reference in New Issue
Block a user