More modal iframe dialog handling improvements

This commit is contained in:
Bernd Bestel
2025-01-11 12:06:15 +01:00
parent 5721c4bd62
commit 2c0b1a7be0
54 changed files with 110 additions and 79 deletions

View File

@@ -31,7 +31,12 @@ $("#clear-filter-button").on("click", function()
{
$("#location-filter").val("all");
$("#location-filter").trigger("change");
Grocy.Components.ProductPicker.Clear();
if (GetUriParam("embedded") === undefined)
{
Grocy.Components.ProductPicker.Clear();
}
stockEntriesTable.draw();
});
@@ -311,11 +316,7 @@ $(window).on("message", function(e)
{
var data = e.originalEvent.data;
if (data.Message == "StockEntryChanged")
{
RefreshStockEntryRow(data.Payload);
}
else if (data.Message == "ProductChanged")
if (data.Message == "ProductChanged")
{
window.location.reload();
}
@@ -328,7 +329,6 @@ function UndoStockBookingEntry(bookingId, stockRowId, productId)
Grocy.Api.Post('stock/bookings/' + bookingId.toString() + '/undo', {},
function(result)
{
window.top.postMessage(WindowMessageBag("BroadcastMessage", WindowMessageBag("StockEntryChanged", stockRowId)), Grocy.BaseUrl);
window.top.postMessage(WindowMessageBag("BroadcastMessage", WindowMessageBag("ProductChanged", productId)), Grocy.BaseUrl);
toastr.success(__t("Booking successfully undone"));
},