mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Remove items from shopping list without reloading the whole page
This commit is contained in:
parent
324487d395
commit
b7f0b06684
@ -23,10 +23,15 @@ $("#search").on("keyup", function()
|
||||
|
||||
$(document).on('click', '.shoppinglist-delete-button', function (e)
|
||||
{
|
||||
Grocy.Api.Get('delete-object/shopping_list/' + $(e.currentTarget).attr('data-shoppinglist-id'),
|
||||
var shoppingListItemId = $(e.currentTarget).attr('data-shoppinglist-id');
|
||||
|
||||
Grocy.Api.Get('delete-object/shopping_list/' + shoppingListItemId,
|
||||
function(result)
|
||||
{
|
||||
window.location.href = U('/shoppinglist');
|
||||
$('#shoppinglistitem-' + shoppingListItemId + '-row').fadeOut(500, function()
|
||||
{
|
||||
$(this).remove();
|
||||
});
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
|
@ -38,7 +38,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($listItems as $listItem)
|
||||
<tr class="@if(FindObjectInArrayByPropertyValue($missingProducts, 'id', $listItem->product_id) !== null) table-info @endif">
|
||||
<tr id="shoppinglistitem-{{ $listItem->id }}-row" class="@if(FindObjectInArrayByPropertyValue($missingProducts, 'id', $listItem->product_id) !== null) table-info @endif">
|
||||
<td class="fit-content">
|
||||
<a class="btn btn-sm btn-info" href="{{ $U('/shoppinglistitem/') }}{{ $listItem->id }}">
|
||||
<i class="fas fa-edit"></i>
|
||||
|
Loading…
x
Reference in New Issue
Block a user