mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 20:26:42 +00:00
Add GET parameter to close window after product creation (#420)
* Add GET parameter to close window after product creation PR for issue #419 This only works when the window was opened by Javascript (eg. from a third party plugin like Barcode Buddy) * Added flow if window closing fails If the window could not be closed, the normal flow continues Added comments * Made GET parameter case insensitive
This commit is contained in:
committed by
Bernd Bestel
parent
e133508814
commit
a0fc06f6ed
@@ -67,6 +67,13 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If the GET parameter "closeAfterCreation" was passed to the form, it will
|
||||
automatically close after creating the product. This only works if the window
|
||||
was opened with javascript */
|
||||
if (window.location.href.toLowerCase().includes("closeaftercreation"))
|
||||
{
|
||||
window.close();
|
||||
}
|
||||
if (redirectDestination == "reload")
|
||||
{
|
||||
window.location.reload();
|
||||
|
Reference in New Issue
Block a user