mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Optimized shopping list done items filter handling (fixes #2169)
This commit is contained in:
parent
6857796ef0
commit
1090f070c9
@ -355,17 +355,24 @@ $(document).on('click', '.order-listitem-button', function(e)
|
||||
Grocy.Api.Put('objects/shopping_list/' + listItemId, { 'done': done },
|
||||
function()
|
||||
{
|
||||
var statusInfoCell = $("#shoppinglistitem-" + listItemId + "-status-info");
|
||||
|
||||
if (done == 1)
|
||||
{
|
||||
$('#shoppinglistitem-' + listItemId + '-row').addClass("text-muted");
|
||||
$('#shoppinglistitem-' + listItemId + '-row').addClass("text-strike-through");
|
||||
statusInfoCell.text(statusInfoCell.text().replace("xxUNDONExx", "xxDONExx"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#shoppinglistitem-' + listItemId + '-row').removeClass("text-muted");
|
||||
$('#shoppinglistitem-' + listItemId + '-row').removeClass("text-strike-through");
|
||||
statusInfoCell.text(statusInfoCell.text().replace("xxDONExx", "xxUNDONExx"));
|
||||
}
|
||||
|
||||
shoppingListTable.rows().invalidate().draw(false);
|
||||
$("#status-filter").trigger("change");
|
||||
|
||||
Grocy.FrontendHelpers.EndUiBusy();
|
||||
},
|
||||
function(xhr)
|
||||
@ -374,20 +381,6 @@ $(document).on('click', '.order-listitem-button', function(e)
|
||||
console.error(xhr);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
var statusInfoCell = $("#shoppinglistitem-" + listItemId + "-status-info");
|
||||
if (done == 1)
|
||||
{
|
||||
statusInfoCell.text(statusInfoCell.text().replace("xxUNDONExx", "xxDONExx"));
|
||||
}
|
||||
else
|
||||
{
|
||||
statusInfoCell.text(statusInfoCell.text().replace("xxDONExx", "xxUNDONExx"));
|
||||
}
|
||||
shoppingListTable.rows().invalidate().draw(false);
|
||||
|
||||
$("#status-filter").trigger("change");
|
||||
});
|
||||
|
||||
function OnListItemRemoved()
|
||||
|
Loading…
x
Reference in New Issue
Block a user