mirror of
https://github.com/grocy/grocy.git
synced 2025-08-21 04:43:32 +00:00
Handle window.top in embedded iframe situations (fixes #2686)
This commit is contained in:
@@ -92,7 +92,7 @@ $(document).on('click', '.stock-consume-button', function(e)
|
||||
Grocy.FrontendHelpers.EndUiBusy();
|
||||
RefreshStockEntryRow(stockRowId);
|
||||
toastr.success(toastMessage);
|
||||
window.top.postMessage(WindowMessageBag("BroadcastMessage", WindowMessageBag("ProductChanged", productId)), Grocy.BaseUrl);
|
||||
Grocy.GetTopmostWindow().postMessage(WindowMessageBag("BroadcastMessage", WindowMessageBag("ProductChanged", productId)), Grocy.BaseUrl);
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ $(document).on('click', '.product-open-button', function(e)
|
||||
}
|
||||
|
||||
RefreshStockEntryRow(stockRowId);
|
||||
window.top.postMessage(WindowMessageBag("BroadcastMessage", WindowMessageBag("ProductChanged", productId)), Grocy.BaseUrl);
|
||||
Grocy.GetTopmostWindow().postMessage(WindowMessageBag("BroadcastMessage", WindowMessageBag("ProductChanged", productId)), Grocy.BaseUrl);
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
@@ -332,7 +332,7 @@ function UndoStockBookingEntry(bookingId, stockRowId, productId)
|
||||
Grocy.Api.Post('stock/bookings/' + bookingId.toString() + '/undo', {},
|
||||
function(result)
|
||||
{
|
||||
window.top.postMessage(WindowMessageBag("BroadcastMessage", WindowMessageBag("ProductChanged", productId)), Grocy.BaseUrl);
|
||||
Grocy.GetTopmostWindow().postMessage(WindowMessageBag("BroadcastMessage", WindowMessageBag("ProductChanged", productId)), Grocy.BaseUrl);
|
||||
toastr.success(__t("Booking successfully undone"));
|
||||
},
|
||||
function(xhr)
|
||||
|
Reference in New Issue
Block a user