diff --git a/public/viewjs/productform.js b/public/viewjs/productform.js index ee803124..d025290f 100644 --- a/public/viewjs/productform.js +++ b/public/viewjs/productform.js @@ -67,7 +67,14 @@ } 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(); }