mirror of
https://github.com/grocy/grocy.git
synced 2025-04-30 01:55:47 +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 },
|
Grocy.Api.Put('objects/shopping_list/' + listItemId, { 'done': done },
|
||||||
function()
|
function()
|
||||||
{
|
{
|
||||||
|
var statusInfoCell = $("#shoppinglistitem-" + listItemId + "-status-info");
|
||||||
|
|
||||||
if (done == 1)
|
if (done == 1)
|
||||||
{
|
{
|
||||||
$('#shoppinglistitem-' + listItemId + '-row').addClass("text-muted");
|
$('#shoppinglistitem-' + listItemId + '-row').addClass("text-muted");
|
||||||
$('#shoppinglistitem-' + listItemId + '-row').addClass("text-strike-through");
|
$('#shoppinglistitem-' + listItemId + '-row').addClass("text-strike-through");
|
||||||
|
statusInfoCell.text(statusInfoCell.text().replace("xxUNDONExx", "xxDONExx"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$('#shoppinglistitem-' + listItemId + '-row').removeClass("text-muted");
|
$('#shoppinglistitem-' + listItemId + '-row').removeClass("text-muted");
|
||||||
$('#shoppinglistitem-' + listItemId + '-row').removeClass("text-strike-through");
|
$('#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();
|
Grocy.FrontendHelpers.EndUiBusy();
|
||||||
},
|
},
|
||||||
function(xhr)
|
function(xhr)
|
||||||
@ -374,20 +381,6 @@ $(document).on('click', '.order-listitem-button', function(e)
|
|||||||
console.error(xhr);
|
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()
|
function OnListItemRemoved()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user