From 1fbda392c2603f6b888c18bf393b042d32a823cd Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 14 Nov 2020 11:49:46 +0100 Subject: [PATCH] Fixed product edit page returnto handling --- public/viewjs/productform.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/public/viewjs/productform.js b/public/viewjs/productform.js index 44ceaa1d..8f86ab65 100644 --- a/public/viewjs/productform.js +++ b/public/viewjs/productform.js @@ -22,7 +22,15 @@ } else if (returnTo !== undefined) { - window.location.href = U(returnTo) + '&product-name=' + encodeURIComponent($('#name').val()); + if (GetUriParam("flow") !== undefined) + { + window.location.href = U(returnTo) + '&product-name=' + encodeURIComponent($('#name').val()); + } + else + { + window.location.href = U(returnTo); + } + } else { @@ -52,7 +60,14 @@ } else if (returnTo !== undefined) { - window.location.href = U(returnTo) + '&product-name=' + encodeURIComponent($('#name').val()); + if (GetUriParam("flow") !== undefined) + { + window.location.href = U(returnTo) + '&product-name=' + encodeURIComponent($('#name').val()); + } + else + { + window.location.href = U(returnTo); + } } else { @@ -147,7 +162,7 @@ if (GetUriParam("flow") == "InplaceNewProductWithName") $('#name').focus(); } -if (GetUriParam("flow") !== undefined) +if (GetUriParam("flow") !== undefined || GetUriParam("returnto") !== undefined) { $("#save-hint").addClass("d-none"); $(".save-product-button[data-location='return']").addClass("d-none");