From 26bbfd557c43c92e1db21b5baf8a92f212bf3042 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Tue, 3 Jan 2017 23:28:03 -0500 Subject: [PATCH] After creating a new item from the dashboard edit-item create page, send the user to the edit item edit page --- resources/assets/js/dashboard.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/dashboard.js b/resources/assets/js/dashboard.js index e158398..d012989 100644 --- a/resources/assets/js/dashboard.js +++ b/resources/assets/js/dashboard.js @@ -306,7 +306,12 @@ function editItemInit() { // functionality to run on success const returnSuccess = function() { hideLoadingModal(); - window.location.href = "/dashboard/" + model; + + if (operation === "create") { + window.location.href = "/" + location.href.replace(/^[^:]*:\/\/[^\/]*\//, "").replace(/\/[^/]*$/, "") + "/" + row_id; + } else { + window.location.href = "/dashboard/" + model; + } }; // add the image from the image upload box for image-upload class elements