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:
Marc Ole Bulling
2019-10-19 10:26:18 +02:00
committed by Bernd Bestel
parent e133508814
commit a0fc06f6ed

View File

@@ -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();
} }