mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 20:36:15 +02: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:
parent
e133508814
commit
a0fc06f6ed
|
|
@ -67,7 +67,14 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (redirectDestination == "reload")
|
/* 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();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user