mirror of
https://github.com/grocy/grocy.git
synced 2026-03-28 07:39:25 +01:00
Properly refresh opened product amount after consume on stock overview page (fixes #114)
This commit is contained in:
parent
c3731b3200
commit
02163c4305
|
|
@ -135,6 +135,20 @@ $(document).on('click', '.product-consume-button', function(e)
|
|||
$(this).text(result.next_best_before_date).fadeIn(500);
|
||||
});
|
||||
$('#product-' + productId + '-next-best-before-date-timeago').attr('datetime', result.next_best_before_date);
|
||||
|
||||
var openedAmount = result.stock_amount_opened || 0;
|
||||
$('#product-' + productId + '-opened-amount').parent().effect('highlight', {}, 500);
|
||||
$('#product-' + productId + '-opened-amount').fadeOut(500, function ()
|
||||
{
|
||||
if (openedAmount > 0)
|
||||
{
|
||||
$(this).text(L('#1 opened', openedAmount)).fadeIn(500);
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).text("").fadeIn(500);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Grocy.FrontendHelpers.EndUiBusy();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user